//функции в JS;
function testFunction() {
console.log("Функция работает");
return 'Возвращаемый результат';
}
//console.log(testFunction());
//const result = testFunction();
//console.log(result)
//const result = console.log('123');
//console.log(result2)
function fnWithArgs(name, age = 18, city = "москва") {
return `Привет, ${name}! Тебе ${age} лет и ты живешь в ${city}.`;
}
console.log(fnWithArgs("Саид", 35, "москва"));
Click Run to execute JavaScript.
Code runs in an isolated environment.
Code runs in an isolated environment.