将整数数组更改为八进制数组

Change Array with Integers into Octal Array

例如,如果有一个数组 x = [34,10,60,5,3] 如何将其转换为八进制数组?

您可以执行以下操作,

x = [34,10,60,5,3]
res = x.map(item => parseInt(item.toString(8)));
console.log(res);