Knowledge Walls
Laya
Hyderabad, Andhra Pradesh, India
Math.prototype.abs() Method in Math Class of Javascript Syntax with Examples
1081 Views
Usage 
The Math.abs(x) function is used to specify the absolute value of a number.
Syntax 
var absolute = Math.abs(x);
Example
var x=Math.abs('-1');    
var y=Math.abs(-2);    
var z=Math.abs(null);
document.write(x,y,z);
Output 
1
2
0
Best Lessons of "Javascript Syntax with Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details