JavaScript Fundamentals - Part One Flashcards
What is a variable?
A variable is a container for a value, like a number we might use in a sum, or a string that we might use as part of a sequence.
How to declare a variable?
let myName;
How to initialize a variable?
let myName = “Chris”;
How to redeclare a variable?
myName = “Bob”;
What are the 7 primitive data types of JavaScript?
Number, String, Boolean, Undefined, Null, Symbol, BigInt
What is the difference between let, const, and var?
We use var if we want function-scoped variables that can be hoisted. let if we want block-scoped variables that can be reassigned. And const if we want block-scoped variables that are constant and cannot be reassigned.
What are the JavaScript Operators?
Assignment Operators, Arithmetic Operators, Comparison Operators, Logical Operators, Bitwise Operators, String Operators, other JavaScript Operators.
What are the Assignment Operators?
=, +=, -=, *=, /=, %=, **=.
What are the Arithmetic Operators?
+, -, *, /, %, ++, –, **.
What are the Comparison Operators?
==, !=, ===, !==, >, >=, <, <=.
What are the Logical Operators?
&&, ||, !.
What are the Bitwise Operators?
&, |, ^, ~, «,»_space;,»_space;>.
What are the String Operators?
Used to concatenate (join) two or more strings.
What are others JavaScript Operators?
(,), ?:, delete, typeof, void, in, instanceof
What is Operator Precedence in JavaScript?
Operator precedence in JavaScript determines the priority of operators in an operation. It determines which operators have higher precedence than others, and thus tells us the order to perform a given mathematical expression. Operators with higher precedence will become the operands of operators with lower precedence.