I'm trying to remove the printed single quotations which occur while running the following code.
I've tried playing around with the replace(/['"]+/g, ''but I'm not getting this correctly.
var arr = ["Alpha", "Omega", "Delta"];
var symbol = "weee";
for(x=0; x<arr.length; x++){
console.log(x,symbol,arr[x]);
}
This returns:
0 'weee' 'Alpha'
1 'weee' 'Omega'
2 'weee' 'Delta'
If the types of console.log parameters are different, string type will be marked by quotation marks, so you can make the parameters to a single string, just like:
console.log(x + ' ' + symbol + ' ' +arr[x]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With