Tech Support Guy banner
Status
Not open for further replies.

web development course help

1K views 2 replies 3 participants last post by  techo3 
#1 ·
this is a free online course... im going through lessons learning basic javascript. please could someone try to help with what ive done wrong? thanks.

Add ["Paul",35] to the beginning of the myArray variable using unshift().

// 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);

Build myStr over several lines by concatenating these two strings:
"This is the first sentence. " and "This is the second sentence." using the += operator.

var myStr = "This is the first sentence."+="This is the second sentence.";

Set someAdjective and append it to myStr using the += operator.

// Example
var anAdjective = "awesome!";
var ourStr = "Free Code Camp is ";
ourStr += anAdjective;

// Only change code below this line

var someAdjective;
var myStr += "Learning to code is ";
 
See less See more
#2 ·
If you haven't worked this out by now, you need to think about what type of thing you're inserting into the array.
You're meant to be inserting a smaller array.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top