Skip to content
New issue

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

Issue in Object Creation Section #204

Open
divyanshu-rawat opened this issue Jan 7, 2017 · 1 comment
Open

Issue in Object Creation Section #204

divyanshu-rawat opened this issue Jan 7, 2017 · 1 comment
Labels

Comments

@divyanshu-rawat
Copy link

There are four ways in which keys and values can then be assigned to an object.
Here in 4th case I am encountering a problem when I console the newObject then it returns an empty object but why so ?
I am using node v7.3.0

// 4. Object.defineProperties
 
// Set properties
Object.defineProperties( newObject, {
 
  "someKey": {
    value: "Hello World",
    writable: true
  },
 
  "anotherKey": {
    value: "Foo bar",
    writable: false
  }
 
});

screenshot from 2017-01-07 17 08 16

@addyosmani addyosmani added the bug label Jul 29, 2017
@dancrumb
Copy link

The property descriptor includes an enumerable key that must be set to true if you want to see it when you print the object to the console.

Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants