Published
Edited
Mar 5, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
typeof(true)
Insert cell
!true
Insert cell
Insert cell
Insert cell
typeof(null)
Insert cell
Boolean(null)
Insert cell
!null
Insert cell
Insert cell
typeof(undefined)
Insert cell
Boolean(undefined)
Insert cell
!undefined
Insert cell
Insert cell
10
Insert cell
typeof(10)
Insert cell
Number('22')
Insert cell
Number('Salut')
Insert cell
Insert cell
typeof(NaN)
Insert cell
Number.isNaN('Salut')
Insert cell
Insert cell
Number.isNaN(Number('Salut'))
Insert cell
Number.isNaN(1)
Insert cell
Number.isNaN('1')
Insert cell
1.234567.toFixed(2)
Insert cell
0.1 + 0.2
Insert cell
Number((0.1 + 0.2).toFixed(2))
Insert cell
Math.floor(1.234)
Insert cell
Math.ceil(1.234)
Insert cell
Math.round(1.234)
Insert cell
Insert cell
'Salut'
Insert cell
typeof('Salut')
Insert cell
'Salut' + '!'
Insert cell
saluer = nom => `Salut ${nom} !`
Insert cell
saluer('Machin')
Insert cell
'Salut'.toUpperCase()
Insert cell
'Salut'.toLowerCase()
Insert cell
'Salut'.includes('lut')
Insert cell
'Ceci est une phrase'.split(' ')
Insert cell
Insert cell
Insert cell
typeof(obj)
Insert cell
obj.nom
Insert cell
Object.keys(obj)
Insert cell
obj2 = ({ ...obj, autre: 'x' })
Insert cell
{
const { age } = obj
return age
}
Insert cell
{
const { age, aFaim } = obj
return { age, aFaim }
}
Insert cell
Insert cell
arr1 = [1, 2, 3]
Insert cell
arr2 = [1, 'Salut', true, { x: 2 }]
Insert cell
arr3 = [...arr2, null]
Insert cell
arr4 = [...arr1, ...arr2]
Insert cell
arr5 = [arr1, arr2]
Insert cell
{
const [premier, deuxieme, ...reste] = [1, 2, 3, 4, 5]
return { premier, deuxieme, reste }
}
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