Published
Edited
Oct 2, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
[1, 2, 3, 4, 5].filter(x => x % 2).map(x => 2*x)
Insert cell
[1, 2, 3, 4, 5].reduce((x,y) => x+y)
Insert cell
[ "hello world", "ciao mondo", "salut monde" ].flatMap( x => x.split(" ") ).sort()
Insert cell
Insert cell
import { sample, info, exercise, util, set, value } from '@lbovet/reactive-course'
Insert cell
Insert cell
filter([1, 2, 3, 4, 5], x => x != 3)
Insert cell
filter = (arr, fn) => arr.flatMap( x => fn(x) ? [x] : [] )
Insert cell
Insert cell
Insert cell
Insert cell
value
Insert cell
set('hello')
Insert cell
setTimeout(() => set(new Date()), 1000)
Insert cell
md`${sample[0]}`
Insert cell
value
Insert cell
$ = require('jquery')
Insert cell
$.get(sample[0], res => set(res.data.first_name))
Insert cell
Insert cell
$.get(sample[1])
.then( res => (set(res.data.first_name), res))
.then( res => util.img(res.data.avatar))
Insert cell
$.get('https://notvalid')
.then( () => 'ok' )
.catch( () => 'not ok' )
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