1/48
A collection of vocabulary terms and definitions related to core concepts of JavaScript, helpful for exam preparation.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Console Object
A debugging tool in JavaScript that shows runtime execution and logs information.
console.error()
Method specifically designed for logging errors in the console.
console.time() and console.timeEnd()
Console methods used for measuring performance of code execution.
console.table()
Displays data in a tabular format for easier reading.
let vs var
'let' is block-scoped while 'var' is function-scoped.
const
Prevents reassignment of the variable, but object properties can still be modified.
Hoisting
A mechanism where variable and function declarations are processed before code execution.
const x = {name: 'John'}; x.name = 'Jane';
Valid use of 'const' declaration as object properties can be modified.
Primitive data type
Basic types in JavaScript such as String, Number, Boolean, Symbol, BigInt, undefined, and null.
typeof null
Returns 'object' in JavaScript.
BigInt
Data type used for representing very large integers beyond the limits of Number.
null vs undefined
null represents an intentional absence of value, while undefined indicates a variable has been declared but not assigned a value.
'5' + 3
Results in '53' due to type coercion in JavaScript.
=== operator
Checks for value equality without type conversion (strict equality).
Falsy values
Values in JavaScript that evaluate to false: false, 0, empty strings, null, undefined, and NaN.
Short-circuit evaluation
Conditionally execute code based on truthiness using && and || operators.
Higher-order function
A function that takes another function as an argument or returns a function.
Function declarations vs expressions
Function declarations can be called before they're defined, while function expressions cannot.
Pure function
A function that always returns the same output for the same input and has no side effects.
Arrow function
A shorter syntax for writing functions using the '=>' syntax.
array.filter()
Method used to create a new array with elements that pass a test.
Access property named 'user-id'
Use obj['user-id'] to access properties with special characters.
Spread operator (…)
Expands an array into individual elements.
Destructuring
Technique to extract values from arrays or properties from objects into distinct variables.
Constructor() method
Method in a class used to initialize new object instances.
'extends' keyword
Creates a child class that inherits from a parent class.
'super' keyword
Used to call methods from the parent class or constructor in a class.
Static method
A method that is called on the class itself, not on instances.
Class vs Constructor function
Classes are syntactic sugar over constructor functions and prototypal inheritance.
JavaScript modules
To organize code, encapsulate functionality, and manage dependencies.
Named exports vs Default exports
Named exports can export multiple values, while default exports can only export one value per module.
Importing a default export
Use import name from './file.js'.
Namespace imports
Importing all exports from a module into a single object.
querySelector() vs getElementById()
querySelector() can select elements using CSS selectors, while getElementById() only selects by ID.
textContent vs innerHTML
innerHTML deals with HTML content, while textContent only deals with plain text.
Event delegation
Adding a single event listener to a parent element that handles events for its children.
classList property
Provides a way to add, remove, and toggle classes on an element.
Promise
An object that represents the eventual completion or failure of an asynchronous operation.
'await' keyword
Pauses execution until a Promise is resolved.
Error handling in async/await code
Handled using try/catch blocks.
Callback hell problem
When nested callbacks become unmanageable, creating deeply nested code.
JSON.stringify()
Converts a JavaScript object into a JSON string.
fetch API initial return
A Promise that resolves to the Response object.
JSON.parse()
Method used to parse a JSON string into a JavaScript object.
Promise.all()
Handles multiple promises together and waits for all of them to resolve.
State of a Promise
A Promise before it is either fulfilled or rejected is called Pending.
HTTP method in fetch API
Uses GET method by default in the fetch API.
Synchronous vs Asynchronous
Synchronous code blocks execution until completed, while asynchronous code allows other code to run while waiting.
Promise.race()
Returns the result of the first promise that resolves or rejects.