9. Other Flashcards
What does === do?
Compares value and type (called strict equal to)
What function checks if a value is a number or not?
isNaN()
(works whether “5” or 5)
How to do OR
||
How to do AND
&&
How to do NOT
!
3 parts of a loop
- Initialization
- Condition
- Update
How to add 1 to i
i++
var fruits = [“Banana”, “Apple”, “Cherry”]; : how to sort fruits?
fruits.sort();
(sorts in alphabetical order or by numbers)
var matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
];
console.log(matrix); :
What will print?
[Array(3), Array(3), Array(3)]
In what are these the comment structures?:
/* This … will be in comment /
/ This is
a multi-line …
comment */
CSS and JavaScript (JS)
In what is this comment structure?:
<!– This … will be in comment –>
HTML
In what is this comment structure?:
// this … will be in comment
JavaScript only