We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
给出一个数组,数组里面的成员可是数值,字符串,对象,数组。找出里面所有的字符串
let arr=[-6.236,3,-21,{a:-11,b:{c:-10}},[11,2.26,[-1,-6,]]] console.log(JSON.stringify(str).split('-').splice(1).map(item=>-Number.parseFloat(item)))
解题思路:首先把数组转成 json ,然后按照 ’-‘ 分割字符,把第一个元素删除,再用 Number.parseFloat 把字符串转成 数值
关键点:Number.parseFloat
Number.parseFloat('12asd31{{}') //12
The text was updated successfully, but these errors were encountered:
No branches or pull requests
给出一个数组,数组里面的成员可是数值,字符串,对象,数组。找出里面所有的字符串
解题思路:首先把数组转成 json ,然后按照 ’-‘ 分割字符,把第一个元素删除,再用 Number.parseFloat 把字符串转成 数值
关键点:Number.parseFloat
The text was updated successfully, but these errors were encountered: