Look at the below code and guess its output: console.log(val); var val; If you have not studied hoisting and if you are learning javascript after learning any other programming language like Java or C++ then your guess will be " that the above code ...
This topic is one of the famous interview questions so therefore we are here to cover this in our blog. Without wasting any time let's move on to the main part. How undefined Work? Undefined is returned by the javascript compiler when a particular va...
Currying is a concept where a function with multiple arguments is divided into multiple functions having 1 or 2 arguments. Syntax of Currying Function function multipleargs(arg1, arg2, arg3, arg4) curriedfunction(arg1)(arg2)(arg3)(arg4) There is an...
In javascript, this keyword behaves differently compared to other languages. This keyword refers to an object and the manner in which it is called will be responsible for telling which object. Mini Question: What will be the output if we console.log ...
In the previous blog, we learned about the basics of promises in javascript. Here is the link if you've missed it: https://pulkitgovrani.hashnode.dev/what-are-promises-in-javascript Now in this blog, we will be learning how promises can handle more t...
If an interviewer asks you "What do you understand by promises"? Then what will be your answer? Here's the cleanest answer from the mdn documentation: " A promise is basically an object which tells the eventual completion or failure of an asynchronou...
Interview Question: If you can guess the output of the below code successfully then you can skip this blog :) Code: let input_array=[1,6,3,7,9,2]; let updated_array=input_array.map((element)=>{ return element<4; }) console.log(updated_array); If...