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 129 views
1 answer 119 views
1 answer 151 views
1 answer 130 views
1 answer 126 views
1 answer 153 views
1 answer 119 views
...