Read only variables are available in JavaScript (es6/es2015). We will use const declarations and their benefits, like read only and block scope.
In this redux (https://github.com/reactjs/redux/blob/master/examples/counter/components/Counter.js) example, I see some code:
const { value, onIncrement, onDecrement } = this.props
Your course did not cover something like this. Could you please explain what does the above do?
This syntax is creating four variables. One for each property of the props object and one for the object as a whole. See this babel translation of the code to ES5. http://tinyurl.com/hwpox2p
Can you talk about the use and values of const function? Is it also just protecting the function variable being assigned to a different value?
Nicely explained.
Could you please tell me how you are running the js file in the built in terminal? Thanks