How to convert a negative number to positive in TypeScript

1 Answer

0 votes
console.log(Math.abs(-5)); 
console.log(Math.abs(-6.189)); 
console.log(Math.abs(-0)); 

 
 
     
     
/*
run:
     
5 
6.189 
0 
     
*/

 



answered Jun 19, 2022 by avibootz

Related questions

1 answer 122 views
1 answer 111 views
1 answer 142 views
1 answer 125 views
1 answer 117 views
1 answer 148 views
1 answer 112 views
...