Public
Edited
May 15
Insert cell
Insert cell
Insert cell
Insert cell
animals = ['cat', 'dog', 'cat', 'bird']
Insert cell
animals.find( animal => animal === 'cat')
Insert cell
animals.find( animal => animal === 'elephant')
Insert cell
Insert cell
store ={ return [
{id:'001', size:['L', 'XL'], color: 'red'},
{id:'002', size:['S', 'M', 'XL'], color: 'black'},
{id:'003', size:['S', 'XL', 'XXL'], color: 'red'}
]}
Insert cell
store.find( item => item.color === 'red')
Insert cell
Insert cell
animals.includes('bird')
Insert cell
animals.includes('elephant')
Insert cell
Insert cell
store.filter( item => item.size.includes('S'))
Insert cell
Insert cell
Insert cell

// myEmptyObject = {}

myEmptyObject = ({
})
Insert cell
Insert cell
myEmptyObject['tavel'] = 0;
Insert cell
myEmptyObject
Insert cell
// add another property with a "variable"
{
const newKey = 'isCool';
myEmptyObject[ newKey ] = true;
}

Insert cell
myEmptyObject
Insert cell
Insert cell
myClone = ({...myEmptyObject})
Insert cell
Insert cell
interest = ({ music:123, food:456})
Insert cell
interestKeys = Object.keys(interest)
Insert cell
interestValues = Object.values(interest)
Insert cell
interestEntries = Object.entries(interest);
Insert cell
interestKeys.map( temp =>{
return {
name: temp
}
})
Insert cell
Insert cell
function filterByColor( myColor ){
const clothes = store.filter( item => item.color === myColor);
return clothes;
}
Insert cell
function saySomething( someWord ){
console.log('HEY!!', someWord)
}
Insert cell
selectedClothes = filterByColor('red')
Insert cell
saySomething('Hola Iryna');
Insert cell
saySomething('Hola Chema');
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