JS Assignment 7
MarindaHeim (0)

I am super new to this and I'm having a lot of trouble on the pre-course. I have been able to find answers to the other questions, but this one I have searched and searched for what I'm doing wrong. I have pasted the questions with the answers I have come up with. Any help would be appreciated, TIA.

https://repl.it/student/submissions/7451920

// Exercise One:
// Step One: Create a function called 'parametersExercise'.
// Step Two: This function will need to take two parameters, call them 'param1' and 'param2'
// Step Three: The function should console log the second parameter.
function parameterExercise (param1, param2){
console.log (param2);
}

// DO NOT CHANGE ANYTHING ON THE NEXT FOUR LINES!
function exerciseTwo(){
function sayMyName(parameter1){
console.log(parameter1);
}
}
// Continue below this line:

// Exercise Two:
// Step One create a variable called 'myName' and assign it the a string of your name.
// Step Two: Call the function called "sayMyName",passing the 'myName' variable as it's only argument.
// NOTE: You do NOT need to create the function (sayMyName), doing so will break the test.
// It has been created for you.

let myname = "Marinda";
sayMyName("myname");

You are viewing a single comment. View All
Answered by vedprad1 (694) [earned 5 cycles]
View Answer
MarindaHeim (0)

@vedprad1
I did everything you said (at least I think I did) and neither are passed. What am I doing wrong?

https://repl.it/student/submissions/7451920

// Exercise One:
// Step One: Create a function called 'parametersExercise'.
// Step Two: This function will need to take two parameters, call them 'param1' and 'param2'
// Step Three: The function should console log the second parameter.
function parameterExercise(param1, param2){
console.log(param2);
}

// DO NOT CHANGE ANYTHING ON THE NEXT FOUR LINES!

function exerciseTwo(){
function sayMyName(parameter1){
console.log(parameter1);
}
}

// Continue below this line:

// Exercise Two:
// Step One create a variable called 'myName' and assign it the a string of your name.
// Step Two: Call the function called "sayMyName",passing the 'myName' variable as it's only argument.
// NOTE: You do NOT need to create the function (sayMyName), doing so will break the test.
// It has been created for you.
let myName = 'Marinda';
sayMyName(myName);