Frage im Vorstellungsgespräch bei Quovantis Technologies

Q What if I use var inside Contstructor function? function Person(firstName, lastName, age){this.firstName=firstName;this.lastName = lastName; var a = 5;}; What will console.log(a); print?

Antworten zu Vorstellungsgespräch

Anonym

11. Juni 2017

It will give compile time error, as you are using a variable outside of its scope.

4

Anonym

27. Jan. 2017

I was not able to answer this