Important Concepts Flashcards

1
Q

What is a variable in JavaScript?

A

A variable is a container that holds a value. It is used to store and manipulate data in a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a function in JavaScript?

A

A function is a reusable block of code that is used to perform a specific task. Functions can take input and return output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an object in JavaScript?

A

An object is a fundamental concept in JavaScript that allows you to store properties and methods in a single unit. Objects are defined using curly braces {} and can have properties and methods that can be accessed using dot notation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an Array in JavaScript?

A

An array is a special kind of object that can hold multiple values in a single variable. The values are stored in a linear fashion and can be accessed by their index.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a Conditional Statement in JavaScript?

A

Conditional statements allow you to specify different actions to be taken depending on certain conditions. if-else and switch statement are the examples of Conditional statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Loop in JavaScript?

A

A loop is a control flow statement that allows you to execute a block of code multiple times. for, for-in, for-of and while are examples of loops in javascript.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a constructor function in JavaScript?

A

A constructor function is a special kind of function that is used to create new objects. Constructor functions are invoked with the “new” keyword and are usually used to set the initial state of an object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are Prototypes in JavaScript?

A

A prototype is an object that is used as a template for creating new objects. It is a mechanism that allows objects to inherit properties and methods from another object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is closure in JavaScript?

A

A closure is a function that has access to variables in its parent scope even after the parent function has returned. Closure allows to create private variables, and to create stateful functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Promises in JavaScript?

A

A promise is an object that represents the eventual completion (or failure) of an asynchronous operation and its resulting value. Promises allow you to write asynchronous code that is easier to read and debug.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Event Loop in JavaScript?

A

The event loop is a mechanism that handles the execution of code in JavaScript. It is responsible for determining when to execute callback functions, and it allows the JavaScript runtime to run multiple tasks in parallel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Asynchronous JavaScript?

A

Asynchronous JavaScript refers to the ability of JavaScript to handle multiple tasks at the same time. It allows your code to run without getting blocked, so the web page remains responsive, and multiple tasks can be handled simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is hoisting in JavaScript?

A

Hoisting is a mechanism in JavaScript where variable and function declarations are moved to the top of the scope, regardless of where they appear in the code. This can lead to unexpected behavior if not handled properly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the keyword this in JavaScript?

A

The keyword this refers to the object that the code is currently being executed in. Its value can change depending on the context in which it is used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is try-catch block in JavaScript?

A

The try-catch block is a way to handle errors that might occur in a program. It works by allowing you to place your code in a try block, and if an error occurs, it will be caught in the catch block, where you can take appropriate action.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are Regular Expressions in JavaScript?

A

Regular expressions are a way to search and match patterns in strings. They are defined using the RegExp constructor and can be used to perform tasks such as validation, pattern matching, and string replacement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is an Immediately-Invoked Function Expression (IIFE) in JavaScript?

A

An IIFE, or Immediately-Invoked Function Expression, is a function that is immediately invoked after it is defined. It allows you to create a scope for variables and functions, effectively hiding them from the rest of the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a generator function in JavaScript?

A

A generator function is a special kind of function that can be paused and resumed. It uses the keyword yield to indicate where the function should be paused and resumed. This allows writing asynchronous code in a more synchronous style.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is JSON in JavaScript?

A

JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate. JSON is a standard format for data exchange between a browser and a server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what is AJAX in JavaScript?

A

AJAX (Asynchronous JavaScript and XML) is a technology that allows you to send and receive data from a server asynchronously, without reloading the entire page. It is used to build dynamic and responsive web applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a webpack in JavaScript?

A

webpack is a JavaScript module bundler. It allows bundling all the js files, CSS, and other resources used in the web application. It can bundle, minify, and optimize the files making the web application run faster and more optimized.

22
Q

What is Lazy Loading in JavaScript?

A

Lazy loading is a technique that defers the loading of resources until they are actually needed. This can improve the performance of a web application by reducing the amount of data that needs to be loaded up front.

23
Q

What is a Virtual DOM in JavaScript?

A

Virtual DOM is a lightweight in-memory representation of the actual Document Object Model (DOM) that allows to efficiently update the UI, by only updating the actual DOM nodes that have changed.

24
Q

What is the difference between let and var in JavaScript?

A

let and var are used for variable declaration in JavaScript, but there are some key differences. let has a block scope and the variable is not accessible outside the block it is declared in, while var has a function scope and the variable is accessible throughout the entire function.

25
Q

What is the spread operator in JavaScript?

A

The spread operator (…) allows you to expand an iterable (e.g. an array or a string) into its individual elements. It can be used to create a new array or to merge multiple arrays.

26
Q

What are default parameters in JavaScript?

A

Default parameters are a feature of JavaScript that allows you to specify default values for function parameters. This means that if a value is not passed for a particular parameter, the default value will be used instead.

27
Q

What is a Map in JavaScript?

A

A Map is a collection of key-value pairs. It is a built-in object that allows you to easily store, access, and update data. Maps are similar to objects, but they have some additional functionality and are more efficient for certain use cases.

28
Q

What is a Set in JavaScript?

A

A Set is a collection of unique values. It is a built-in object that allows you to easily store, access, and update data. Sets are similar to arrays, but they only store unique values and are more efficient for certain use cases.

29
Q

What is a Symbol in JavaScript?

A

A Symbol is a unique, immutable data type that can be used as a property key. It can be used to create object properties that can’t be accessed using string keys.

30
Q

What is Destructuring in JavaScript?

A

Destructuring is a feature of JavaScript that allows you to extract values from arrays or objects into individual variables. It can be used to simplify code by making it more readable and less verbose.

31
Q

What is a Class in JavaScript?

A

A class is a blueprint for creating objects. Classes allow you to create objects with the same properties and methods and they can be used to define a contract that an object should follow.

32
Q

What is the spread operator in JavaScript?

A

The spread operator (…) allows you to expand an iterable (e.g. an array or a string) into its individual elements. It can be used to create a new array or to merge multiple arrays.

33
Q

What is Async/Await in JavaScript?

A

Async/Await is JavaScript keywords that allow you to write asynchronous code in a more synchronous-looking way, making it easier to read and understand. It allows you to write asynchronous code using synchronous code syntax.

34
Q

What is a Ternary operator in JavaScript?

A

The ternary operator is a shorthand way of writing an if-else statement in JavaScript. It can be used to test a condition and return a value based on the outcome.

35
Q

What is Event Bubbling in JavaScript?

A

Event bubbling is a mechanism that allows events to be propagated up the DOM tree. It happens when an event is triggered on a child element

36
Q

What is Event Capturing in JavaScript?

A

Event capturing is a mechanism that allows events to be propagated down the DOM tree. It happens before the event reaches the target element and it can be used to track events at the top level of the DOM tree.

37
Q

What is Event Delegation in JavaScript?

A

Event delegation is a technique where an event handler is attached to a parent element and it (the event handler) listens to the events on its child elements. It allows for avoiding adding event listeners to individual elements and reduces the number of event listeners that need to be managed.

38
Q

What is the bind() method in JavaScript?

A

The bind() method creates a new function that, when called, has its ‘this’ keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. It allows calling a function with a specific this value.

39
Q

What is the call() method in JavaScript?

A

The call() method calls a function with a given this value and arguments provided individually. It allows calling a function with a specific this value and individual arguments.

40
Q

What is the apply() method in JavaScript?

A

The apply() method calls a function with a given this value and arguments provided as an array. It allows calling a function with a specific this value and an array of arguments.

41
Q

What is a WeakMap in JavaScript?

A

A WeakMap is a collection of key-value pairs, similar to a Map, but its keys must be objects and the references to the keys are held weakly, allowing them to be garbage collected if there are no other references to them.

42
Q

What is a WeakSet in JavaScript?

A

A WeakSet is a collection of unique values, similar to a Set, but the references to its values are held weakly, allowing them to be garbage collected if there are no other references to them.

43
Q

What is a Currying in JavaScript?

A

Currying is a technique of breaking down a function that takes multiple arguments into a sequence of functions that each take a single argument. This can make the code more reusable and composable.

44
Q

What is a Recursion in JavaScript?

A

Recursion is a technique of calling a function from within itself until a certain condition is met. It can be useful for solving problems that can be broken down into smaller sub-problems.

45
Q

What is a Higher-Order Function in JavaScript?

A

A higher-order function is a function that takes one or more functions as arguments or returns a function as its result. It allows abstract functionality and writing more flexible and reusable code.

46
Q

What is a Composition in JavaScript?

A

Composition is a technique of combining small, single-purpose functions to create more complex functionality. It allows for building more complex functionality by composing simple functions together.

47
Q

What is a Partial Application in JavaScript?

A

Partial application is a technique of creating a new function by pre-filling some of the arguments of an existing function. It allows the creation of specialized versions of a function that are tailored to specific use cases.

48
Q

What is a Transpilation in JavaScript?

A

Transpilation is the process of converting code written in one programming language to another, often to a more compatible version. It allows using modern language features even in environments that don’t support them.

49
Q

What is a Proxy in JavaScript?

A

A Proxy is an object that acts as an intermediary between a target object and the code that interacts with it. It allows one to intercept and manipulate the behavior of an object.

50
Q

What is a Reflect API in JavaScript?

A

Reflect API is a built-in object that provides a way to interact with objects in a more reflective way. It allows us to perform the same operations as the usual Object methods, but it also has some additional methods and it throws exceptions when the methods fail.