-
-
Notifications
You must be signed in to change notification settings - Fork 153
All tasks completed #55
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
|
||
let name = undefined; | ||
let name = 'Roman'; | ||
|
||
module.exports = { name }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
|
||
const year = undefined; | ||
const year = 1984; | ||
|
||
module.exports = { year }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
'use strict'; | ||
|
||
const hello = null; | ||
const hello = name => console.log(`Hello ${name}!`); | ||
// hello('Roman'); | ||
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. Don't commit commented code |
||
|
||
module.exports = { hello }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
'use strict'; | ||
|
||
const range = null; | ||
const range = (start, end) => { | ||
const array = []; | ||
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. That's ok, but you can allocate array of predefined size with |
||
for (let i = start; i <= end; i++) { | ||
array.push(i); | ||
} | ||
return array; | ||
}; | ||
|
||
module.exports = { range }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
'use strict'; | ||
|
||
const rangeOdd = null; | ||
const rangeOdd = (start, end) => { | ||
const array = []; | ||
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. Ditto |
||
for (let i = start; i <= end; i++) { | ||
(i % 2 !== 0) ? array.push(i) : ''; | ||
} | ||
return array; | ||
}; | ||
|
||
module.exports = { rangeOdd }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
'use strict'; | ||
|
||
const square = null; | ||
const square = x => x * x; | ||
|
||
const cube = null; | ||
const cube = x => x ** 3; | ||
|
||
const average = null; | ||
const average = (a, b) => (a + b) / 2; | ||
|
||
const calculate = (start = 0, end = 9) => { | ||
const array = []; | ||
for (let i = start; i <= end; i++) { | ||
array.push(average(square(i), cube(i))); | ||
} | ||
return array; | ||
}; | ||
|
||
const calculate = null; | ||
|
||
module.exports = { square, cube, average, calculate }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
'use strict'; | ||
|
||
const fn = null; | ||
const fn = () => { | ||
const object1 = { name: 'Roman' }; | ||
let object2 = { name: 'Serge' }; | ||
object1.name = 'Foma'; | ||
object2.name = 'Alex'; | ||
object2 = { url: 'https://github.com' }; | ||
}; | ||
|
||
module.exports = { fn }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
|
||
const createUser = null; | ||
const createUser = (name, city) => ({ name, city }); | ||
|
||
module.exports = { createUser }; |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,7 +1,13 @@ | ||||||||||||
'use strict'; | ||||||||||||
|
||||||||||||
const phonebook = null; | ||||||||||||
const phonebook = [ | ||||||||||||
{ name: 'Marcus Aurelius', phone: '+38044555443' }, | ||||||||||||
{ name: 'Alex', phone: '+91454329566' }, | ||||||||||||
]; | ||||||||||||
|
||||||||||||
const findPhoneByName = null; | ||||||||||||
const findPhoneByName = name => { | ||||||||||||
for (const person of phonebook) | ||||||||||||
return person.name === name ? person.phone : null; | ||||||||||||
Comment on lines
+9
to
+10
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.
Suggested change
|
||||||||||||
}; | ||||||||||||
|
||||||||||||
module.exports = { phonebook, findPhoneByName }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
'use strict'; | ||
|
||
const phonebook = null; | ||
const phonebook = { | ||
marcus: { name: 'Marcus Aurelius', phone: '+380445554433' }, | ||
alex: { name: 'Alex Dobrov', phone: '+914543295661' } | ||
}; | ||
|
||
const findPhoneByName = null; | ||
const findPhoneByName = name => phonebook[name].phone; | ||
|
||
module.exports = { phonebook, findPhoneByName }; |
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.