We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

whip • 4 years ago

good helpfull

Letty • 4 years ago

thanks very much, this article explains very clearly!

Miles Williams • 4 years ago

console.log(ownerName + ", this is your car: " + this.registrationNumber + " " + this.brand);
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

Niraj Kumar • 2 years ago

it is really helpfull for me

Cong Minh Official • 2 years ago

thanks so much

smrakib24 • 3 years ago

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 }}