I'm trying to convert object values into integers:
var array = {
borderTopLeftRadius:"0px",
borderTopRightRadius:"0px",
borderBottomLeftRadius:"0px",
borderBottomRightRadius:"0px"
}
I want to keep the same structure, but the result should look like this:
var array = {
borderTopLeftRadius:0,
borderTopRightRadius:0,
borderBottomLeftRadius:0,
borderBottomRightRadius:0
}
I've been using $map to do it, but I cant make it work
var newArray = $.map(array, function(value){
return parseInt(value, 10);
});
arrayisn't actually an array. It's an object.parseInt("0px", 10)works as expected.