Common JS Questions

  1. How to write a comment in JavaScript?
  2. What does the isNaN() function?
  3. What is the output of “10”+20+30 in JavaScript?
2 Likes
  1. ctrl+/
  2. whether a value is NaN (not- a -number) when converted to a number
  3. 102030
1 Like
  1. Single-line comment: Use two forward slashes (//) before the comment. Anything written after these slashes on the same line will be considered a comment and will not be executed as a code.

  2. Multi-line comment: Enclose the comment within /* and */. Anything written between these symbols will be considered a comment and will not be executed as a code.

The isNaN() function in JavaScript stands for “is Not a Number”. It is used to determine whether a value is a NaN value or not. This function returns true if the value passed to it is NaN, false otherwise.

The output of "10" + 20 + 30 in JavaScript is "102030" .

2 Likes

1 .ctrl+/
2. To determine num is value or not
3. 102030

1 Like
  1. //
  2. (not- a -number) when converted to a number, this function returns true if the value passed to it is NaN, false otherwise.
  3. 102030
1 Like
  1. //
  2. NaN (not-a-number)
  3. The output of “10” + 20 + 30 in JavaScript is “102030”
1 Like

1.Ans:- ctrl+/
2.Ans:- NaN Function is used to check whether a given value is an illegal number or not.
syntax:- isNaN ( value )
3.Ans:- output:-102030

1 Like

1.By making using of // symbol
2.isNaN() checks whether input is number or not
3.1050

1 Like

1.//
2.not and number
3.1050

1 Like

1.Using forward slash( //) or using shortcut ctrl+/ or shift+Alt+a
2.it will giving result as true or false ,the value is a number ,result is false else true
3.102030 => + symbol concat the numbers because one of the given value is string

done