showing results for - "remove negative sign from number javascript"
Eleonora
04 Mar 2019
1var array = [18, -42, 21, 6, -50];
2array = array.filter(function(x) { return x > -1; });
3console.log(array); // [18, 21, 6]
Lucas
10 Mar 2016
1Math.abs('the negative number')
2Math.abs(-4)//returns 4
3Math.abs(4)//returns 4