1
JS Assignment 12: Methods, Loops and the `this` Keyword
maximussallam (2)

function exerciseOne(){
// Exercise One: In this exercise you are given an object called 'mathHelpers'
// Within mathHelpers, create a method called 'double'
// This method should take one parameter, a number,
// and it should return that number multiplied by two.
let mathHelpers = {
// Create double method in here.

};
return mathHelpers;
}

I have no clue what to do here. I've watched the Lambda School: Methods, Loops, and the 'this' Keyword video 5 times and I'm still confused as to what they want me to do.

https://www.youtube.com/watch?v=FNfaU-bVdqM&feature=youtu.be

You are viewing a single comment. View All
3
vedprad1 (435)
function exerciseOne() {
  let mathHelpers = {
    double: function (num) {
      return num * 2;
    }
  };
  return mathHelpers;
}

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

1
maximussallam (2)

@vedprad1 OOOHHHHHHHHHHHHH!!!!! Yeah, I could have watched the video 50 times and I wouldn't have figured that out. Thank you so much!

3
vedprad1 (435)

@maximussallam : Could you mark my answer as correct? Thanks!

1
maximussallam (2)

@vedprad1 I'm sorry. I'm new to using this platform. I thought up voting it was the same as marking it correct. How do I mark it correct?

3
vedprad1 (435)

@maximussallam : You click on the checkmark to the left side of the top message.

1
maximussallam (2)

@vedprad1 I found it. It was hidden. Didn't appear until i hovered the mouse over it. Thanks again for your help!