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
No description provided.
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
function animal() { this.name = 'animal'; this.colors = ['red', 'blue', 'green']; } animal.prototype.getName = function() { return this.name; } function dog() { } dog.prototype = new animal(); const dog1 = new dog(); console.log('dog1.name:', dog1.getName()); // animal console.log('dog1.colors:', dog1.colors); // ['red', 'blue', 'green'] dog1.name = 'dog'; dog1.colors.push('black'); // 引用类型的值会共享 const dog2 = new dog(); console.log('dog2.name:', dog2.getName()); // animal console.log('dog2.colors:', dog2.colors); // ['red', 'blue', 'green', 'black']
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: