Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Defining a Compound Function | Mastering Functions
Introduction to JavaScript

bookChallenge: Defining a Compound Function

Task

Swipe to start coding

  • Define a new function called showStudentData having parameters: name, age and score.
  • Inside the showStudentData function:
    1. Use two console.log lines to output the name and age of the student in the following format:

      Name: John Smith  
      Age: 24
      
    2. Call the getGrade function using score as an argument.

  • Finally, call the showStudentData function with the following arguments: "Alice", 22, 97.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 8
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 1.33

bookChallenge: Defining a Compound Function

Swipe to show menu

Task

Swipe to start coding

  • Define a new function called showStudentData having parameters: name, age and score.
  • Inside the showStudentData function:
    1. Use two console.log lines to output the name and age of the student in the following format:

      Name: John Smith  
      Age: 24
      
    2. Call the getGrade function using score as an argument.

  • Finally, call the showStudentData function with the following arguments: "Alice", 22, 97.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 8
single

single

some-alt