Course Content
Introduction to JavaScript
Challenge: My Name
Task
Implement the function to output a sentence:
- Function should be named
myName
. - Function should get one argument
name
. myName
function body contains theconsole.log()
function, which should print the sentence"My name is {name}"
.- Call the
myName
function thrice with different names.
The output should be:
Hint
1. Function definition:
2. Put argument
3. Call the function with different names (choose it yourself).
The function call:
function funcName(argument){}
.
2. Put argument
name
to the console.log()
function.
3. Call the function with different names (choose it yourself).
The function call:
funcName(value)
after definition.
Section 6.
Chapter 3