Post

codedamn
codedamn@codedamncom·
Top 100 JavaScript Interview Questions and Answers in 2023: Thread [Part 3]:
English
13
127
510
92K
codedamn
codedamn@codedamncom·
Part 3 starts here:
English
1
0
1
2K
codedamn
codedamn@codedamncom·
Q21. What is NaN in JavaScript? NaN is an abbreviation for “Not a Number.” It represents a value that is not a valid number in JavaScript.
English
1
0
5
1.9K
codedamn
codedamn@codedamncom·
Q22. What is debouncing in JavaScript? The debouncing technique prevents a function from being called again until a particular time has passed since the last call. Its primary application is in Web application search functionality. The API is called only once per user input.
English
1
0
6
1.8K
codedamn
codedamn@codedamncom·
Q23. How to get the type of a variable? To know the type of a JavaScript variable, we can use the typeof operator.
codedamn tweet media
English
1
0
4
1.5K
codedamn
codedamn@codedamncom·
Q24. Explain the call(), apply(), and bind() methods. The call() method invokes a function with the specified context and parameters.
codedamn tweet media
English
1
0
3
1.3K
codedamn
codedamn@codedamncom·
The apply() method invokes a function with the context specified and the arguments provided as an array (or an array-like object). It is similar to call(), except that it accepts parameters in the form of an array.
codedamn tweet media
English
1
0
1
1.2K
codedamn
codedamn@codedamncom·
The bind() method generates a new function that, when called, has this keyword set to the specified context, with a sequence of arguments preceding it. It’s similar to call(), except instead of calling the function directly, it returns a copy of the new function.
English
1
0
3
1K
codedamn
codedamn@codedamncom·
Q25. What are the three types of JavaScript errors?
English
1
0
2
924
codedamn
codedamn@codedamncom·
Syntax Error: The syntax of the program is not correct. Reference Error: The JavaScript Engine cannot find a reference to a variable or function in memory. Type Error: Trying to reassign a const variable will lead to a Type Error.
English
2
0
4
879
codedamn
codedamn@codedamncom·
Q26. What is the use of this keyword in JavaScript? In JavaScript, the this keyword points to the object currently referred. The this keyword is widely used to assign values to object attributes in constructors.
English
1
1
3
932
codedamn
codedamn@codedamncom·
Q27. What is the difference between async and defer? In async, while parsing HTML, the browser fetches the script from the network asynchronously if we encounter a script. After fetching the script, the browser stops parsing HTML and executes the script.
English
1
1
4
888
codedamn
codedamn@codedamncom·
After executing the script, the browser resumes the HTML parsing. In defer, while parsing HTML, the browser fetches the script from the network asynchronously if we encounter a script. The browser executes the scripts only after parsing the HTML.
English
1
1
2
822
codedamn
codedamn@codedamncom·
Q28. What are cookies? Cookies are small data packets that the server sends to the client. The client stores the cookie inside the browser and sends it to the server on each future request.
English
1
1
4
848
codedamn
codedamn@codedamncom·
Q29. What is the difference between let and var keywords? Both let and const are used for declaring a variable in JavaScript. The var keyword variables have function scope, while the let keyword variables have block scope.
English
1
1
3
1.1K
Paylaş