Published
Edited
Sep 4, 2019
6 forks
Insert cell
Insert cell
Insert cell
Insert cell
{
var orderedNumberList =
{
first: 1,
second: 2,
third: 3,
fourth: 4,
fifth: 5,
sixth: 6,
seventh:7,
eighth: 8,
ninth: 9,
tenth: 10
}
return orderedNumberList;
}
Insert cell
Insert cell
orderedNumberList = [1,2,3,4,5,6,7,8,9,10]
Insert cell
Insert cell
orderedNumberList.indexOf(4);
Insert cell
orderedNumberList[2]
Insert cell
Insert cell
{
var orderedNumberList = [1,2,3,4,5,6,7,8,9,10]
return orderedNumberList[0];
}
Insert cell
Insert cell
wonkyArray = ["bob", -2.5, true, "Solly the Sexy Saxaphone"]
Insert cell
Insert cell
emptyArray = [] //this is how we declare an empty array
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
theirArmy = ["dog1","dog2","dog3","dog4"] //do not change
Insert cell
ourArmy = ["superKitty"] //do not change
Insert cell
Insert cell
allAnimals = ourArmy + theirArmy
Insert cell
allAnimalsII = allAnimals.addDoggo("superDoggo")
Insert cell
allAnimalsIII = allAnimalsII.findIndexOfSuperKitty()
Insert cell
allAnimalsIV = allAnimalsII.removeThatSuperDoggoCuzITypoedHisNameO()
Insert cell
Insert cell
{
try
{
expect(allAnimals).to.deep.equal(["superKitty","dog1","dog2","dog3","dog4"])
expect(allAnimalsII).to.deep.equal(["superKitty","dog1","dog2","dog3","dog4","superDoggo"])
expect(allAnimalsIII).to.equal(0)
expect(allAnimalsIV).to.deep.equal(["superKitty","dog1","dog2","dog3","dog4"])
return success()
}
catch(err)
{
return failure()
}
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more