-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (49 loc) · 1.98 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<body>
<h1>Mutable Values</h1>
<script>
/*
PROBLEM 1: Create a variable named str and set it equal to the string "hello"
Next use bracket notation to try to mutate the string like this:
str[0] = 'H';
Now console log the variable str to see if it has changed
Did the variable change? Why do you think that is?
*/
//ENTER YOUR CODE HERE
/*
PROBLEM 2: Create a variable named num and set it equal to the number 5
Next use += to add three to the num variable like this:
num += 3;
Now console log the variable num to see if it has changed
Did the variable change? Why?
*/
//ENTER YOUR CODE HERE
/*
PROBLEM 3: Here is an object named obj containing a car called a "Honda" and owned by someone named "John".
On the second line, use the right side of the equal sign to change the owner's name to "Tony"
Now console log obj to see if it has changed.
Did the object change? Why?
*/
let obj = { owner: "John", car: "Honda" };
//ENTER YOUR CONSOLE LOG HERE
/*
PROBLEM 4: Here is an array named arr containing an array of numbers.
On the second line, inside the parentheses, add the number 4.
Now console log arr to see if it has changed
Did the array change? Why?
*/
let arr = [1, 2, 3];
arr.push();
//ENTER YOUR CONSOLE LOG HERE
/*
PROBLEM 5 (DEBUGGING): In the following snippet, we want to change the punctuation at the end of the string.
We're trying to directly modify the string, but like in our first problem, it's not working.
Fix the code so that the string is changed to "Welcome to Bloomtech!"
*/
// let message = 'Welcome to Bloomtech?';
// message[20] = '!';
// console.log(message);
</script>
</body>
</html>