Insert cell
Insert cell
Insert cell
Insert cell
function sum(a, b) {
return a+b
}
Insert cell
function mult(a, b) {
return a*b
}
Insert cell
function execFunction (func, a, b) {
return func(a,b)
}
Insert cell
execFunction(mult, 5, 2)
Insert cell
function retFunction(func1, func2, selector) {
if(selector)
return func1
else
return func2
}
Insert cell
retFunction(sum,mult,true)(5,10)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getDog(animal) {
if(animal.species==='dog')
return true
return false
}
Insert cell
function getCat(animal) {
if(animal.species==='cat' || animal.species==='kitty')
return true
return false
}
Insert cell
Insert cell
animalArray.filter(getDog)
Insert cell
animalArray.filter(getCat)
Insert cell
Insert cell
Insert cell
Insert cell
function countCats( currentCount, animal) {
if(animal.species==='cat'||animal.species==='kitty')
return currentCount + 1
return currentCount
}
Insert cell
animalArray.reduce(countCats, 0)
Insert cell
Insert cell
Insert cell
Insert cell
function getAnimalName(animal) {
return animal.name
}
Insert cell
animalArray.map(getAnimalName)
Insert cell
Insert cell
Insert cell
kittyArray = ['bob', 'sammy', 'hello', 'sammy', 'just a kitty', 'super kitty', 'mr. butters']
Insert cell
Insert cell
function toName( inputArray ) {
//Code Here
}
Insert cell
Insert cell
Insert cell
function toObject( inputArray ) {
//Code Here
}
Insert cell
Insert cell
Insert cell
function toCart( foodArray ) {
//Code Here
}
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more