JS Assignment 7: Arguments and Parameters
ReinierB (15)

JS Assignment 7: Arguments, I do not know what is going on, The console is printing what they asking for to be undefined, but I still get an error? im passing the second exercise, but not the first. It is a bug or am I doing something wrong that i cant see? i check stackflow some people were having the same problems without solutions.
// 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.

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

// Continue below this line:
function parametersExercise(param1, param2) {
console.log(param2);
}

parametersExercise();

// 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 = "Reinier";
sayMyName(myName);
}
exerciseTwo();

You are viewing a single comment. View All
JwalyaOza (3)

i just cannot understand what the hell is happening with me.. despite of doing exactly what you said and eventually getting my second exercise right i'm still not able to clear the first exercise and whenever i press run tests button they say "expected undefined to be function" what the hell does that mean? do i have to print anything? please is there anyone who can find me suitable and correct way of solving the exerscise 1?

ReinierB (15)

@JwalyaOza Hi, i skipped the first one, kept going because i didn't manage to pass the first one! it is crazy. just keep going and come back later on

JwalyaOza (3)

@ReinierB . do you think there might be something wrong with my server? do you think that main reason behind not being able to clear the 1st exercise would be unstable server of mine? i really don't think so.. what yaa say? anyways i was able to get my 2nd exercise right and i submitted it anyway. lets see what happens further

ReinierB (15)

@JwalyaOza it is weird i managed to pass the second one too, but the first one is badly written or the way the asked..

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

}

// Continue below this line:
function parametersExercise(param1, param2) {
console.log(param2);
}

parametersExercise("param1", "param2");

// 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 = "Reinier";
sayMyName(myName);
}
exerciseTwo();

JwalyaOza (3)

@ReinierB. By the way if you do not mind.. I gotta have someone's guidance in order to finish the assignment as quick as possible...And I think you can help me. Actually despite of performing couple of codes I am not able to get the correct answer of any of the exercises of Js assignment 8.. and I have to finish it as fast as possible in order to continue further..So can you please help me to find the correct answer of the exercises in assignment 8.. I really need help. It's my humble request to you and also the one who are doing the same thing alongside...Please guide me

ReinierB (15)

@JwalyaOza Sure, share your code! or i can send to you how i did

ReinierB (15)

@JwalyaOza

let school = 'Lambda';
let className = 'Intro to Web Dev'

function nameMySchool(){
  let className = "Web Development Fundamentals"
  console.log(school);
}

nameMySchool();
console.log(className);
// Do not change any code above this line!


// Exercise One: 
// Part One: Create a variable called 'inFunction' and 
//           assign it to the value that will be logged
//           on line 7.
let inFunction =  "Lambda";

// Part Two: Create a variable called 'outsideFunction' and
//           assign it to the value that will be logged on  
//           line 11.
let outsideFunction = "Intro to Web Dev";


// Exercise Two:
// Create a Function called 'multipliesTwoNumbers'. It will take two parameters
// call these parameters 'num1' and 'num2'. Return the two parameters multiplied together.
 function multipliesTwoNumbers(num1,num2) {
   return num1 * num2;
 }

// Exercise Three:
// Create a function called 'sayMyName'. It will take one parameter. Call this
// parameter 'myName'. Return the phrase "Hello, my name is " and the myName parameter.
// eg: if name is 'Dan' it should return the string: 'Hello, my name is Dan'.
function sayMyName(myName) {
  
  return "Hello, my name is " +  myName ;
}
sayMyName(myName);
ReinierB (15)

@JwalyaOza here is the code, but before you move on, try to understand why at least

JwalyaOza (3)

@ReinierB. Hey pal.. thanks a lot for helping me to complete this assignment. Thank you so much I hope I also get helpful to you someday. by the way the only thing I wasn't able to understand was what to write next to infunction.. and now my doubt has got cleared. Thank you friend. And now let's hope it gets accepted and something like what happened in the 7th assignment does not gets repeated

ReinierB (15)

@JwalyaOza it is my pleasure! by helping others is the best way to learn... :)

JwalyaOza (3)

@ReinierB. Man I seriously need your help once again for the quarries which I am getting In the 9th assignment. Please pal I need your guidance once again in order to finish the 9th assignment.. I hope you can help buddy

JwalyaOza (3)

@ReinierB. I really need help to complete the js assignment 9. i hope you can give me from proper guidance so that i can complete it and move ahead. please do it buddy.

ReinierB (15)

@JwalyaOza `// Exercise One: Create a vaiable called 'numbersArray',
// assign it to an array containing 5 numbers (any numbers).
let numbersArray = [2,34,4,5,6];

// Exercise Two: Create a variable called 'cars',
// assign it to an array containing the names of three cars.
let cars = ['honda', 'Hunday', 'Chevy'];

function exerciseThree(bandsArray){
// Exercise Three: In this function you will be given an array called 'bandsArray'.
// console log the third band in the array.
// Note: DO NOT create a new array in this challenge.
// Note: Remember that array indecies start at 0.
console.log(bandsArray[2]);
}

function exerciseFour(citiesArray){
// Exercise Four: In this function you will be given an array called 'citiesArray.
// re-assign the fourth city in the array to 'Santa Fe'.
// Note: DO NOT create a new array in this challenge.
// Note: Remember that array indecies start at 0.
citiesArray[citiesArray.length -2];
citiesArray[3] = 'Santa Fe';

// Complete your work on the line above.
return citiesArray;
}

here is my solution! remember to try to understand why

JwalyaOza (3)

@ReinierB . sure man thanks for helping and i will try my level best to understand it well and do it in a precise manner and if i'll get any quarries i'll contact you.but first.. i'll try to understand it well and get my concept cleared about the phenomenon behind that particular assignment

royohms (0)

@ReinierB were you able to get the model solution? I am currently stuck trying to figure it out. any help on what I should do? I am still yet to get anyone right