JavaScript Fundamentals Flashcards
(72 cards)
What was JavaScript initially called?
LiveScript
What is the specification for JavaScript?
ECMAScript
True or False: JavaScript and Java are the same.
False
List three benefits of using JavaScript.
- Full integration with HTML/CSS
- Simple things are done simply
- Support by all major browsers and enabled by default
What is the primary task of a JavaScript engine?
To convert (compile) the JavaScript to machine-executable binaries.
What are two examples of JavaScript engines?
- V8 (Chrome, Opera, Edge)
- SpiderMonkey (Firefox)
What is the basic structure of JavaScript code?
JavaScript commands are written in statements separated by semicolons.
What are the keywords used to declare a variable in JavaScript?
- const
- var
- let
What characters are allowed in variable names?
- Letters
- Digits
- Symbols $ and _
What is the special value that represents nothing in JavaScript?
null
What does the Boolean type represent?
Two values: true and false.
What is the maximum safe integer value in JavaScript?
2**53 - 1 (9,007,199,254,740,991) - just over 9 quadrillion
Fill in the blank: In JavaScript, a _______ is a special value that indicates a variable has been declared but not assigned a value.
undefined
What is the syntax to create a string with embedded expressions?
Backticks (``)
True or False: All data types in JavaScript are considered primitive except for objects.
True
What operator is used to check the type of a variable?
typeof
What is the result of typeof null?
object
What is the purpose of the String class function in type conversion?
To explicitly convert other types to strings.
What happens during implicit numeric conversion in JavaScript?
Strings are automatically converted to numbers in mathematical operations.
List three values that convert to false in Boolean conversion.
- ””
- 0
- null
What does a variable declared but not assigned a value return when logged?
undefined
How can you create a BigInt in JavaScript?
By appending ‘n’ to an integer.
What is a key characteristic of JavaScript as a programming language?
JavaScript is a dynamically typed language.
What is the output of console.log(NaN ? ‘NaN is true’ : ‘NaN is false’)?
NaN is false