Skip to content

AbiyuTashoma/lesson-task-js1-module1-CreateHTMLFunction

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript 1 - Module 1

Lesson Task 4 Questions

Question 1

Create a function called printSeason that accepts one argument (has one parameter) called season.

Inside the function log the value of the argument.

Call the function and pass in the value "summer` as the argument.

Question 2

Create a function called printNumbers that has two parameters, firstNumber and secondNumber.

Inside the function log each value that is passed in.

Call the function and pass in two numbers as the arguments.

Question 3

Create a function called addNumbers that has three parameters.

Inside the function add all the paramters and return the result.

Assign the result to a variable and assign the variable to the innerHTML property of the DOM element with the class of total.

Question 4

Create a function called createGreeting that has one parameter.

Inside the function add the value passed in to the string "Hello, my name is " and return the new string.

Assign the returned value to the innerHTML property of the DOM element with the id of name.

Question 5

Create a function called printListItems that has one parameter.

Inside the function loop through the value passed in and log each item.

Call the function and pass the sports array in script.js in as the argument.

Question 6

Create a function called createGames that has one parameter.

Inside the function loop through the value passed in, create HTML for each property in each object and return the HTML.

Provide a default value for the released property if it is missing.

Assign the return value of the function to the innerHTML property of the DOM element with the class of game-container.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.3%
  • HTML 16.9%
  • CSS 6.8%