You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
// -> Add 'core' to robby.parts, cranky.parts should still be empty
// -> Add 'fly' to robby.capabilities, after doing that cranky.capabilities must
// also have 'fly' without adding to it directly, so this property has to be
// shared
official solution:
robby.parts.push('core');
robby.capabilities.push('fly');
working solution:
robby.parts = ['core'];
robby.proto.capabilities.push('fly');
Please correct me if I am wrong here, but it looks like the array.push updates the values for both instances.
The text was updated successfully, but these errors were encountered:
hi @greph robby.parts.push('core') should not update the value of both instances, but this really depends on where you declare the 'parts' array. Figuring this out is part of the exercise.
// -> Add 'core' to robby.parts, cranky.parts should still be empty
// -> Add 'fly' to robby.capabilities, after doing that cranky.capabilities must
// also have 'fly' without adding to it directly, so this property has to be
// shared
official solution:
robby.parts.push('core');
robby.capabilities.push('fly');
working solution:
robby.parts = ['core'];
robby.proto.capabilities.push('fly');
Please correct me if I am wrong here, but it looks like the array.push updates the values for both instances.
The text was updated successfully, but these errors were encountered: