main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const person = {  
  name: 'Dave',
  surname: 'Bowman'
};

const personB = Object.create(person, {  
  profession: {
    value: 'Astronaut',
    enumerable: true
  }
});
console.log(personB.profession); // => 'Astronaut'  
console.log(personB.name);       // => 'Dave'  
console.log(personB.surname);    // => 'Bowman'

console.log(personB.hasOwnProperty('profession')); // => true  
console.log(personB.hasOwnProperty('name'));       // => false  
console.log(personB.hasOwnProperty('surname'));    // => false  
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie