Method placed inside object, function still doesn't work.
JoshBorthick (1)

Hi everyone,

Edit: (from here:
--Attributes of a bad question: does not include link to repl or does include code in a codeblock? This seems counter intuitive, but to follow this logic I have not placed my code in a codeblock.--

Edit: Ok, I get it now, it wants the repl link only:

I am given a challenge among two in JS Assignment 12: Methods, Loops, and the this Keyword.

Here's my input for trying to solve:
double: double(number) {
return number*2

The template I used is from here:
It's the first code block in the "Methods" section.

What other info than the instructions should I learn to do this?

Further Edit: I've tried a bunch of different ways, like:
mathHelpers.double: method() {
mathHelpers[double]: method() {
mathHelpers[double] = method() {
mathHelpers["double"]: method() {
mathHelpers["double"] = method() {
mathHelpers.double = method() {
and so forth. I would have googled it but I have no idea how to word the search. I'm not sure what I'm not doing right, or what right is.

Here is my error:
ReferenceError: exerciseOne is not defined
at eval (eval at n.evaluate (, <anonymous>:4:14)
at (
at n.execute (
at e.M as queueRunnerFactory
at e.execute (
at e.fn (
at (
at n.execute (

You are viewing a single comment. View All
JoshBorthick (1)

@Zavexeon Thanks for the resource, but I had a free account with them that has already expired. Their tiny free JS tutorial only has like 3 parts to it, anyway, teaching how to make bubbles and sparks on the screen or something. Did you find some part of their JS tutorial that goes more in depth? Where is this?

Does that mean that the method will not be named double, as the instructions specified? Should it be actually called function(number), not double(number)?

Also, the page came with return mathHelpers already there. I figured that meant I was supposed to leave it. It actually is inside the exerciseOne() function.

So, here's what I've got so far:

function exerciseOne() {
  let mathHelpers = {
    double: function(num) {
      return num * 2;
return mathHelpers

Still a no-go.

Edit: The only thing I was expected to supply was the double key and method for value, everything else was already there.

Edit2: Unless you meant that it's outside the function because it's not indented.