![]() Let us understand it with the help of simple code snippets where we get the value as undefined. ![]() ![]() In simple words, if any value is not been explicitly assigned to a variable then javascript calls it undefined. In general, javascript assigns undefined to any variable that has been declared but not been defined or initialized. Other than that it has a lot to do with how the javascript code is executed. Undefined is a very special keyword in javascript and it is not there in other languages. Other than that the best part about these errors is that in a javascript interview they are asked a lot of times to test your basic knowledge about javascript. To overcome this challenge we will be discussing undefined, not defined, and null in javascript so that you can get a good understanding of it. ![]() While running code in javascript you might have seen errors like undefined, not defined, etc, and would have got confused by seeing them. ![]()
0 Comments
Leave a Reply. |