Expert Developer JavaScript Question:

Download Job Interview Questions and Answers PDF

What are Math Constants and Functions using JavaScript?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

Answer:

► Math object has two constant : Math.PI and Math.E
► Math object has following functions :
Math.abs(val1); :It will give absolute value of val1.
Math.max(val1,val2); :This fuction will return maximum value from val1 and val2.
Math.random(); :This function will return a random number between 0 and 1.
Math.floor(val1) :This function will returns decimal value of val1.

Download Expert JavaScript Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Explain with an example the use of event handlers in JavaScript?What is Strict Mode in JavaScript?