-
Notifications
You must be signed in to change notification settings - Fork 7
some more methods #3
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,3 +6,21 @@ exports.pluralize = function (count, singular, plural) { | |||||||||
| return `${count} ${plural}`; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
|
|
||||||||||
| exports.pluralize_v2 = function (count, singular, plural) { | ||||||||||
| if (count === 1) { | ||||||||||
| return `${count} ${singular}`; | ||||||||||
| } | ||||||||||
| plural = plural || `${singular}s`; | ||||||||||
| return `${count} ${plural}`; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| exports.method = function (count) { | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Delete
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Delete
Suggested change
|
||||||||||
| for(let i = 0; i < count; i++){ | ||||||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
|
||||||||||
| const j = 9 | ||||||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
|
||||||||||
| while(j>count){ | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
|
||||||||||
| console.log("counting") | ||||||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
|
||||||||||
| j-- | ||||||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
|
||||||||||
| } | ||||||||||
| } | ||||||||||
| }; | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| "use strict"; | ||
| var fs = require("fs"); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| exports.doSomething = function() { | ||
|
|
||
| for (var i = 0; i < 10; i--) { | ||
| } | ||
|
|
||
| for (var i = 10; i >= 0; i++) { | ||
| } | ||
|
|
||
| var x = 5;; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| var key = 'key' | ||
|
|
||
| var object = { | ||
| key: 'yes! ' | ||
| } | ||
|
|
||
| if (!key in object) { | ||
| // operator precedence makes it equivalent to (!key) in object | ||
| // and type conversion makes it equivalent to (key ? "false" : "true") in object | ||
| } | ||
|
|
||
| }; | ||
|
|
||
| function foo(a, b, a) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| typeof a === undefined | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| console.log("value of the second a:", a); | ||
| } | ||
|
|
||
| var bar = function (a, b, a) { | ||
| console.log("value of the second a:", a); | ||
| }; | ||
|
|
||
| function fn() { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| x = 1; | ||
| return x; | ||
| x = 3; // this will never execute | ||
| } | ||
|
|
||
| (() => { | ||
| try { | ||
| return 1; // 1 is returned but suspended until finally block ends | ||
| } catch (err) { | ||
| return 2; | ||
| } finally { | ||
| return 3; // 3 is returned before 1, which we did not expect | ||
| } | ||
| })(); | ||
|
|
||
| let foo = function () { | ||
| try { | ||
| return 1; | ||
| } catch (err) { | ||
| return 2; | ||
| } finally { | ||
| return 3; | ||
| } | ||
| }; | ||
|
|
||
| let result; | ||
| async function foo() { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| result += await somethingElse; | ||
|
|
||
| result = result + await somethingElse; | ||
|
|
||
| result = result + doSomething(await somethingElse); | ||
| } | ||
|
|
||
| function* bar() { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| result += yield; | ||
|
|
||
| result = result + (yield somethingElse); | ||
|
|
||
| result = result + doSomething(yield somethingElse); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.