What role does JavaScript play in a browser?
JavaScript is the programming language browsers use to add behavior to web pages.
Study 5 JavaScript Fundamentals with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What role does JavaScript play in a browser?
JavaScript is the programming language browsers use to add behavior to web pages.
Name common JavaScript value types.
Common JavaScript values include numbers, strings, and booleans. Arrays, objects, and functions are also values.
How do `null` and `undefined` differ?
`null` represents an intentional absence of a value; `undefined` often means a value has not been assigned.
What does it mean that JavaScript is dynamically typed?
JavaScript is dynamically typed: a variable can hold values of different types at different times.
What can `+` do with numbers and strings?
The `+` operator adds numbers, but joins strings together.
What does `===` test in JavaScript?
`===` checks whether two values are equal without converting their types first.
When should you use `const` versus `let`?
Use `const` when a variable binding will not be reassigned, and `let` when it needs to change.
What is the scope of `const` and `let`?
`const` and `let` are limited to the surrounding block, the code enclosed in `{ }`.
Can a `const` object or array have its contents changed?
A `const` binding cannot be reassigned, but an object or array it refers to can still have its contents changed.
What is a JavaScript function for?
A function groups instructions so they can be run by calling it, helping make actions reusable.
How do function parameters and arguments differ?
A parameter is the function's named input; an argument is the value supplied for it in a function call.
What does `return` do in a function?
`return` sends a value back and ends that function call. A function without a return value evaluates to `undefined`.