var price = [ Rs 299, Rs 499, Rs 899, Rs 199 ];
I need to store this [ 299, 499, 899, 199] in an array.
If your array elements are strings this should work
let array = [ 'Rs 299', 'Rs 499', 'Rs 899', 'Rs 199' ]
console.log(array.map(elem => Number(elem.split(' ')[1])))
We can use string match() here for a regex based solution:
var array = ["Rs 299", "Rs 499", "Rs 899", "Rs 199"];
var nums = array.map(x => Number(x.match(/\d+(?:\.\d+)?/)[0]));
console.log(nums);