JavaScript Basics Flashcards
What is the data type that is missing: string, number, boolean, null…
undefined
What is the instruction to display something in the console?
console.log
How do you comment a single line?
//
Instruction to display a message in a pop up window
alert
Instruction to display the kind of variable
typeof
What is the data type that is missing: string, number, boolean, undefined…
null
How to comment multiple lines?
/**/
Instruction to display a field in a pop up window?
prompt
What is the sign used to check if a variable is equal to something?
===
How do you code AND?
&&
How do you code OR?
||
If you are older than 18 you can drink beer, if not you can drink juice. How do you code this using the 2 following variables: beverage and age?
var beverage = age > 18 ? ‘beer’ : ‘juice’;
What is used in a switch statement?
case and break
What would you use in a switch statement to assign a value that is not assigned by “case”?
default
What would you use if you want to use an equality operator with a string and a number?
==