Published
Edited
Jul 3, 2018
Insert cell
Insert cell
Insert cell
{
const add = (a, b) => {
return a + b
}
return add(2, 3)
}
Insert cell
Insert cell
Insert cell
{
const add = (a, b) => a + b
return add(2, 3)
}
Insert cell
Insert cell
{
const add = (a, b) => const sum = a + b
return add(2, 3)
}
Insert cell
Insert cell
{
const add = (a, b) => return a + b
return add(2, 3)
}
Insert cell
Insert cell
{
const returnNumber = x => x
return returnNumber(10)
}
Insert cell
{
const square = x => x * x
return square(10)
}
Insert cell
Insert cell
{
const returnTwo = () => 2
return returnTwo(111)
}
Insert cell
Insert cell
{
const makePerson = (name, lastname) => ({
name: name,
lastname: lastname
})
return makePerson('Mateusz', 'Choma')
}
Insert cell
Insert cell
{
const makePerson = (name, lastname) => {
return {
name: name,
lastname: lastname
}
}
return makePerson('Mateusz', 'Choma')
}
Insert cell
Insert cell
Insert cell
{
const foo = () => arguments

return foo(1, 2, 'Ala', {}, [5,6])
}
Insert cell
{
const sumAllArgumentsWithHOF = (...args) => args.reduce((reduced, element) => reduced + element, 0)
return sumAllArgumentsWithHOF(1, 2, 3, 4 ,5)
}
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