Manipulate Arrays With unshift() -- "my is not defined"

Tell us what’s happening:

All the exercises have been very easy so far, but I can’t see what I’m doing wrong here.
It keeps saying:

"
// running tests

my is not defined

// tests completed
"

Preformatted text

`
Could it be a bug?

Your code so far


my// Example
var ourArray = ["Stimpson", "J", "cat"];
ourArray.shift(); // ourArray now equals ["J", "cat"]
ourArray.unshift("Happy"); 
// ourArray now equals ["Happy", "J", "cat"]

// Setup
var myArray = [["John", 23], ["dog", 3]];
myArray.shift();

// Only change code below this line.

myArray.unshift(["Paul", 35]);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0.

Link to the challenge:
WOULDN’T LET THE AUTOGENERATED LINK TO BE ICLUDED. Seriously??
Removed the http prefix and the learn.freecodecamp///org part. Hopefully it works:
learn.***/javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-unshift

You autogenerate a link to a challenge and then don’t allow me to post with it?? Then why do you autogenerate it? This is really stupid!

The error

my is not defined

is trying to tell you that there’s a my somewhere that the program don’t know how to treat it…

Looking at your code:

my// Example . <--- !!!!!!!!!!!!!
var ourArray = ["Stimpson", "J", "cat"];
ourArray.shift(); // ourArray now equals ["J", "cat"]
ourArray.unshift("Happy"); 
// ourArray now equals ["Happy", "J", "cat"]

there is literally a “my” typed.
Have you tried get rid of it? :slight_smile:

hope it helps :+1:

1 Like

OMG thank you!

I feel so stupid.
I didn’t consciously type ‘my’ there. My touchpad is set to highest sensitivity. The cursor probably moved when I started typing and touched the touchpad.

Again, thank you!

1 Like