Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any one explain the ouput of following JavaScript Code? #1284

Closed
Soorajgit opened this issue May 27, 2019 · 1 comment

Comments

@Soorajgit
Copy link

commented May 27, 2019

var count = function ()
{
this.c = 0 ;
var add = function () {
return ++this.c;
};

this.addNum = function (n)
{
for(i= 0; i<n ; i++) {
}
return this.c ;
};
}

Output of this and explanation since i am new JS.
console.log(new count().addNum(10));
or
console.log(new count.add());

@LinusU

This comment has been minimized.

Copy link
Member

commented May 27, 2019

This is the issue tracker for a particular linting style for JavaScript, and it's not for general JS questions ☺️

@LinusU LinusU closed this May 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.