Cursos /
Introduction to JavaScript
Challenge: My Name
Task
Implement a function to output a sentence:
- Name the function
myName
. - The function should accept one argument,
name
. - The
myName
function body should contain aconsole.log()
statement that prints the sentence"My name is {name}"
. - Call the
myName
function three times with different names.
The output should be:
- Function definition:
function funcName(argument) {}
. - Place the argument name inside the
console.log()
function. - Call the function with different names (choose them yourself).
- Call the
funcName
function after defining it using thefuncName(value)
syntax.
¿Todo estuvo claro?
Sección 6. Capítulo 3
Contenido del Curso
Introduction to JavaScript
4. Conditional Statements
Introduction to JavaScript
Challenge: My Name
Task
Implement a function to output a sentence:
- Name the function
myName
. - The function should accept one argument,
name
. - The
myName
function body should contain aconsole.log()
statement that prints the sentence"My name is {name}"
. - Call the
myName
function three times with different names.
The output should be:
- Function definition:
function funcName(argument) {}
. - Place the argument name inside the
console.log()
function. - Call the function with different names (choose them yourself).
- Call the
funcName
function after defining it using thefuncName(value)
syntax.
¿Todo estuvo claro?
Sección 6. Capítulo 3