HI All,
In my js file i am getting an array of records (negetive values ) like this
deletedDetailIds = $.map(eformDetailIds, function(e) { return e < 0 ? e : null; });
For example the deletedDetailIds = -1234,-1235,-1256 like this.
Now i have to create an array and add these values with out negetive symbols. like
newArray = 1234,1235,1256.
Please help me in this
The correct way would be to use
Math.abs:You could also multiply with
-1.You are dealing with numbers. Only the string representation contains a
-to indicate the negative value, so you cannot really remove the first character here.