Published
Edited
Oct 26, 2018
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
{
let resultArray = []
for( let i = 0; i< array.length; i++) {
if( array[i] < 30 ) resultArray.push(array[i])
}
return resultArray
}
Insert cell
Insert cell
lessThanThirty = x => x < 30
Insert cell
array.filter( lessThanThirty )
Insert cell
Insert cell
Insert cell
digitToLetters = x => (""+x).split("").map( d => ["a","b","c","d",'e','f','g','h','i','j'][d-1] ).join("")
Insert cell
array.map(digitToLetters)
Insert cell
Insert cell
Insert cell
reducer = (agg, curVal ) => agg + curVal
Insert cell
initialValue = 0
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