DEV Community

Discussion on: Negative Number to Positive Number without using abs() - asked in a interview

Collapse
aarone4 profile image
Aaron Reese

So another answer would be to convert it to a string, replace "-" with "" and convert back to a number.