Question
Function and Function Arguments (2 parts) (create and test in console) Part 1) Using JavaScript, declare a function named square which has a variable 'x'
Function and Function Arguments (2 parts) (create and test in console)
Part 1) Using JavaScript, declare a function named square which has a variable 'x' which is 5 then returns x multiplied by itself (squares the number). Then execute that function at the end of your code, the returned result should automatically print out in the console (being the last value run.)
Part 2) Using JavaScript, declare a function named square which has one argument/parameter/input and returns that argument multiplied by itself (squares the number). Then execute that function given the number 5, the returned result should automatically print out in the console (being the last value run
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started