Given the following code:
var x = variable[y];
What is y:
- Index
- Key
- Index of key
- Array
var x = s.toLowerCase();
var l = s.length;
Indicate the type of each:
sxs.toLowerCase()s.toLowerCases.lengthl
Indicate whether this is an expression or a statement:
ll = 4;l == 4if (l == 4) { console.log("yes"); }console.log("yes");"yes"- `console.log(l == 4 ? "yes" : "no")
How can you tell whether something is a statement? How can you tell whether something is an expression
Bonus: List all statements in the code above List all expressions in the code above
Write code for the following:
- Declare a variable called
xand initialize it with the string "Hello". - Declare a variable called
yand initialize it with the propertylengthofx. - Declare a variable called
zand initialize it with the result of calling the methodtoUpperCaseonx
