Skip to content
Advertisement

Tag: class-fields

What is the difference between class fields and properties in Javascript

I’m reading class fields proposal for JavaScript. I don’t understand why the authors call it ‘fields’ and not properties. MDN docs in class article speak about instance properties declared inside constructor and in next section about field declarations declared using new syntax. What is the difference between the two besides the syntax? Answer What is the difference between the two

eslint Parsing error: Unexpected token =

Why is eslint throwing this error? The Javascript runs without issue inside of React Native. The code was taken from the react-navigation example at : https://reactnavigation.org/docs/intro/ Javascript: eslint error: .eslintrc.js file: Answer The syntax is not yet standardised, but a stage-2 proposal for inclusion in Javascript (see “Class Fields” on https://github.com/tc39/proposals). Try adding the following option above “extends” in your

Advertisement