Skip to main content

Posts

Featured

Java Script Interview Questions and Answers

Question -  What would be output of below code ? typeOf(null) typeOf(undefined) Answer -  object, undefined  Explanation - typeof method is used to identify the type of value provided into function parameter as null value is provided into method and null is value and its type is object and for value provided undefined into parameter type will always undefined. Question - How to add new method into array ? Answer - Array.Prototype.methoName = function(){}; Explanation - Array is class and prototype is used to inherit or add new method into existing class so methodName will be added into Array class and we can define our defination inside custom method of array.

Latest Posts