Created
May 5, 2021 19:24
-
-
Save iamkevinlowe/bcd1c3ffc090b81ef441ed41b961706d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Protect the networkDefinitions object so that it is not mutable */ | |
const networkDefinitions = { | |
gmb: { | |
name: 'Google My Business' | |
}, | |
bbb: { | |
name: 'Better Business Bureau' | |
} | |
}; | |
// Write your code here | |
// End | |
networkDefinitions.foo = { name: 'Bar' }; | |
networkDefinitions.gmb.name = 'GMB'; | |
console.clear(); | |
console.log('Running assertions'); | |
console.assert(!networkDefinitions.hasOwnProperty('foo'), "networkDefinitions shouldn't contain foo"); | |
console.assert(networkDefinitions.gmb.name === 'Google My Business', "gmb name should be Google My Business"); | |
console.log('Finished assertions'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment