0

How can I display array values in one line using the console

function main() { var increase = parseInt(readLine(), 10); var prices = [98.99, 15.2, 20, 1026]; //your code goes here var i; for (i=0;i < prices.length;i++) { prices[i] += increase; console.log(prices[i]); } } For example: [ 107.99, 24.2, 29, 1035 ]

18th Dec 2020, 3:58 AM
Krishneel Sharma
Krishneel Sharma - avatar
2 Respuestas
+ 1
console.log(prices)
18th Dec 2020, 4:05 AM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Thanks a lot CarrieForle That was too easy.. And I didn't knew about that😅😅😅
18th Dec 2020, 4:09 AM
Krishneel Sharma
Krishneel Sharma - avatar