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

typo needed to compare to 'undefined' not undefined #547

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion default-parameters-es6/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
function greetES5(message, to) {
// Test parameter values in the function body, specifying a default
to = to || 'DOM';
// OR if (typeof to === undefined) { to = 'DOM'; }
// OR if (typeof to === 'undefined') { to = 'DOM'; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think undefined is right, because comment says, if to is undefined then to = 'DOM'. means if to is falsy value undefined then assign 'dom' into to.

// OR if (arguments.length === 1) { to = 'DOM'; }
ChromeSamples.log(message + ', ' + to);
}
Expand Down