You can use the JavaScript typeof operator to find the type of a JavaScript variable. It returns the type of a variable or an expression.
1 2 | typeof "John Abraham" // Returns "string" typeof (1 + 2) // Returns "number" |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.