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
实现一个函数clone,可以对JavaScript中的5种主要的数据类型(包括Number、String、Object、Array、Boolean)进行值复制
The text was updated successfully, but these errors were encountered:
let newobj let str if (typeof obj !== 'object') { return } else if (window.JSON) { str = JSON.stringify(obj) newobj = JSON.parse(str) } else { for (const i in obj) { if ({}.hasOwnProperty.call(obj, i)) { newobj[i] = typeof obj[i] === 'object' ? this.clone(obj[i]) : obj[i] } } } return newobj
Sorry, something went wrong.
No branches or pull requests
实现一个函数clone,可以对JavaScript中的5种主要的数据类型(包括Number、String、Object、Array、Boolean)进行值复制
The text was updated successfully, but these errors were encountered: