JS_HOME_WORK/09-arrow-function/solution.js
2025-02-05 08:47:22 +01:00

23 lines
809 B
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** ЗАДАЧА 9 - Стрелочная функция
*
* 1. Объявите переменную и присвойте ей стрелочную функцию
*
* 2. У функции не должно быть параметров
*
* 3. Явно верните из функции строку "Привет, мир!"
*
* 4. Вызовите функцию и выведите результат в консоль
*
* 5. Перепишите функцию так, чтобы результат возвращался неявно
*/
// // Явный возврат результата
// const helloWorld = () => {
// return 'Привет, мир!'
// }
// Неявный возврат результата
const helloWorld = () => 'Привет, мир!'
console.log(helloWorld())