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 Answers
+ 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