-
Notifications
You must be signed in to change notification settings - Fork 0
HW#2 Khyzhniak #2
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?
Conversation
This reverts commit 86bc786.
DmitryKorolDevPro
left a comment
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.
Great!
| function example1_8_0() { | ||
| var dmytroKhyzhniak; | ||
| let coolDmytroKhyzhniak; | ||
| const dmytroKorol; | ||
| } | ||
|
|
||
| // 1.8.1 In other languages you can see PascalCase, snake_case, kebab-case. | ||
| function example1_8_1() { | ||
| var ThisIsPascalCase; | ||
| let this_is_snake_case; | ||
| } |
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.
not necessary. primarily depends on the agreements on the project
| // BUILDING STRARTED 🕐 | ||
| let floor1 = 'Floor #1 | □ □ | LET'; | ||
| const floor2 = 'Floor #2 | □ □ | CONST'; | ||
| var floor3 = 'Floor #3 | □ □ | VAR'; | ||
| let floor4 = function() { return 'Floor #4 | □ □ | LET FUNCTION EXPESSION' }; | ||
| const floor5 = function() { return 'Floor #5 | □ □ | CONST FUNCTION EXPESSION' }; | ||
| var floor6 = function() { return 'Floor #6 | □ □ | VAR FUNCTION EXPESSION' }; | ||
| function floor7() { return 'Floor #7 | □ □ | FUNCTION DECLARATION' }; | ||
| // ✅ BUILDING COMPLETED ✅ |
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.
I got the idea, but it's better to use formatting by the first character in the line)
| let user = { | ||
| name: "Dmytro", | ||
| platform: "PC", | ||
| } | ||
|
|
||
| function setUserToken(user) { | ||
| let todaysToken = '25006eb5cb6b9aa164f8fc50e06546d3'; | ||
|
|
||
| function generateCustomToken() { | ||
| let randomID = Math.round(Math.random() * 1000); | ||
| // TODO: check if ID is free | ||
| let generatedToken = `${randomID}#${todaysToken}`; | ||
| user.token = generatedToken; | ||
|
|
||
| return generatedToken; | ||
| } | ||
|
|
||
| return generateCustomToken(); | ||
| } | ||
|
|
||
| console.log(setUserToken(user)); |
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.
"default value for a function" - meanы something like
function coolFunc(data = 11) { console.log(data); }
HW#2 done.