Yes, this is intentional (a part of the spec). If an object has an own property (.property
in your example), this property will be used and not an inherited one. If that property is existent, but is an accessor property without a getter, then undefined
will be returned.
Notice that this behaviour has not changed from ES5.
Related Contents:
- How to implement private method in ES6 class with Traceur [duplicate]
- ES6 class variable alternatives
- Private properties in JavaScript ES6 classes
- Declaring static constants in ES6 classes?
- Call static methods from regular ES6 class methods
- Get the class name of ES6 class instance
- How to extend a class without having to use super in ES6?
- What are getters and setters for in ECMAScript 6 classes?
- Nested ES6 classes?
- ECMAScript 6: what is WeakSet for?
- ES6 modules: Export single class of static methods OR multiple individual methods
- Create an instance of a class in ES6 with a dynamic name? [duplicate]
- ES6 Dynamic class names
- How to mock dependencies for unit tests with ES6 Modules
- Using ES6 Classes as Angular 1.x directives
- Why doesn’t JavaScript ES6 support multi-constructor classes?
- “This” within es6 class method [duplicate]
- Typescript export vs. default export
- Transforming a Javascript iterable into an array
- How to map/reduce/filter a Set in JavaScript?
- What’s the difference between prettier-eslint, eslint-plugin-prettier and eslint-config-prettier?
- setState doesn’t update the state immediately [duplicate]
- Object destructuring without var, let or const
- Javascript re-assign let variable with destructuring [duplicate]
- Arrow function without curly braces
- Vuex: Call getters from action
- Difference between async/await and ES6 yield with generators
- Best way to polyfill ES6 features in React app that uses create-react-app
- How to do a nested if else statement in ReactJS JSX?
- ES6 – Call static method within a class
- How to loop over object properties with ngFor in Angular
- What is the temporal dead zone?
- ES6 deep nested object destructuring
- Is Number.IsNaN() more broken than isNaN()
- What is the difference between browserify/requirejs modules and ES6 modules [closed]
- Why does Object.assign() require a polyfill when babel-loader is being used?
- How to check if a Promise is pending [duplicate]
- Use :hover to modify the css of another class?
- destructuring falsy and null with default parameters
- A module cannot have multiple default exports
- How to use ReactDOM.createPortal() in React 16?
- Why does the Airbnb style guide say that relying on function name inference is discouraged?
- Why does `obj.foo = function() { };` not assign the name `foo` to the function?
- Can I extend Proxy with an ES2015 class?
- Official information on `arguments` in ES6 Arrow functions?
- How can I prevent my functional component from re-rendering with React memo or React hooks?
- JavaScript asynchronous programming: promises vs generators
- How can I write a generator in a JavaScript class?
- Javascript object bracket notation ({ Navigation } =) on left side of assign
- Why is `throw` invalid in an ES6 arrow function?