var devMountainEmployees = [];
var tyler = {
name: 'Tyler',
position: 'Lead Instructor/Engineer',
spiritAnimal: 'Honey Badger'
};
var cahlan = {
name: 'Cahlan',
position: 'CEO',
spiritAnimal: 'butterfly'
};
var ryan = {
name: 'Ryan',
position: 'Marketing',
spiritAnimal: 'fox'
};
var colt = {
name: 'Colt',
position: 'Everything really',
spiritAnimal: 'Young Male Horse'
}
//Above you're given an empty array with four objects. Fill the devMountainEmployees array with those four objects. After that console.log the length of the Array and make sure that it's equal to 4.
//your code here
devMountainEmployees.push(tyler, cahlan, ryan, colt);
console.log(devMountainEmployees);
//Now let's say Cahlan has a mental breakdown and has to take a leave of absense to 'find himself'. Loop through your devMountainEmployees until you find cahlan, then remove him from the array.
//your code here
for (var i = 0; i < devMountainEmployees.length; i++) {
if (devMountainEmployees[i] === cahlan) {
devMountainEmployees.splice(i, 1);
}
}
//Now console.log your final array and make sure that it's correct.
console.log(devMountainEmployees);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.