We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
thanks very much, this article explains very clearly!
console.log(ownerName + ", this is your car: " + this.registrationNumber + " " + this.brand);
Really??
Yuck!!
How about...console.log(`${ownerName}, this is your car: ${this.registrationNumber} ${this.brand});
Please use backticks and expression interpolation and not concatenation.
For a solid style guide I like to refer to https://github.com/airbnb/javascript
it is really helpfull for me
thanks so much
In the beginning of this article on first point of 'Basic rules worth remembering:' section stated that the value of ''this'' is always an object. I am sorry to say that this is not true. Spouse we pass 1 as argument on bind function which associated with certain function invocation. Then the value of ''this '' is
one. We can set any type of data as ''this''. I attached a small code here.
let x = {
i: function() {
return this
}
};
let a = x.i.bind(1);
let b = x.i.bind(x);
console.log(a()) // 1
console.log(b()) // { i: function() { return this }}
good helpfull