This function doesn't perform complete freeze. Object.keys(object) lists only own enumerable properties, leaving behind the non-enumerable ones. For example:
Object.keys(object)
const o = Object.create(null, { prop1: {value:{word:'Hello'}, writable: true, configurable: true, enumerable: true}, prop2: {value:{word:'World'}, writable: true, configurable: true, enumerable: true}, prop3: {value:{word:"Don't forget me!"}, writable: true, configurable: true, enumerable: false}, }); Object.deepFreeze(o); o.prop3.word === "Don't forget me!"; --> true o.prop3.word = "I've been left unfrozen:-("; o.prop3.word === "I've been left unfrozen:-("; --> true
🐱🏍 great!
github.com/aloisdg/awesome-regex
Nice one! where can I learn about this kinds regex
Such a sweet, well-written solution. Even looking at it makes me feel better (and a bit jealous.)
You could make it even simpler with Object.values instead of Object.keys and thus avoid [] accessors
Object.values
Object.keys
[]
This comment is hidden because it contains spoiler information about the solution
this code is incredibly fast due to the absence of a split-join chain
I was thinking about how to get the names passed down as well...but always forgot that functions are first-order objects
I cheated with global variable instead -_________-
This returns true with a bad pw of input "fjd3IR9.;" Will incorrectly approve it.
I'm not sure what you mean. Whatever it is, it was a coincidence, as ES2015 wasn't really a thing back when I did this (2013)!
Loading collection data...
This function doesn't perform complete freeze.
Object.keys(object)
lists only own enumerable properties, leaving behind the non-enumerable ones. For example:🐱🏍 great!
github.com/aloisdg/awesome-regex
Nice one! where can I learn about this kinds regex
Such a sweet, well-written solution. Even looking at it makes me feel better (and a bit jealous.)
You could make it even simpler with
Object.values
instead ofObject.keys
and thus avoid[]
accessorsThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
this code is incredibly fast due to the absence of a split-join chain
I was thinking about how to get the names passed down as well...but always forgot that functions are first-order objects
I cheated with global variable instead -_________-
This comment is hidden because it contains spoiler information about the solution
This returns true with a bad pw of input "fjd3IR9.;"
Will incorrectly approve it.
This comment is hidden because it contains spoiler information about the solution
I'm not sure what you mean. Whatever it is, it was a coincidence, as ES2015 wasn't really a thing back when I did this (2013)!
Loading more items...