- What is the result of the following statements? Why?
!!0 == '0'
!0 -> true
!!0->false
false == '0' => true
3 + '4'
34
2 * 7 / 0
x/0 = infinity
var pers = {
name: 'John',
age: 34
}
pers.name - John
pers['age'] - 34
- What does this program do?
const result = prompt("What language are we learning?");
if(result === "javascript"){
console.log("You're right!");
}
else{
console.log("No!");
}
prompts for 'javascript' and prints a message according to the input
- Modify the program form exercise 2 so it will ask until you get the right answer?
var result;
do {
result = prompt("What language are we learning?");
}
while (result !== "javascript");
- Given a number, write a program that will log the Fibonacci sequence until it reaches the given number.