This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Weather | |
Утилита командной строки, возвращающая информацию о погоде для выбранного города. Она должна уметь обращаться к двум разным сервисам, каждый из которых выбирается флагом --service. | |
weather --service <тут название> berlin | |
Список бесплатных API для работы с погодой можно найти тут https://github.com/toddmotto/public-apis | |
Для реализации cli рекоммендую использовать commander js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Добавьте в Function.prototype функцию wrap, которая работает согласно примеру: | |
function speak(name) { | |
return `Hello ${name}`; | |
} | |
const newSpeak = speak.wrap((original, yourName, myName) => { | |
const greeting = original(yourName); | |
return `${greeting}, my name is ${myName}`; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Добавьте в Object.prototype функцию hash, которая позволяет извлекать вложенные значения из объекта. | |
const obj = { | |
person: { | |
name: 'joe', | |
history: { | |
hometown: 'bratislava', | |
bio: { | |
funFact: 'I like fishing.', | |
}, |