Published
Edited
Sep 22, 2018
1 star
Insert cell
Insert cell
Insert cell
showValues = n => Object.getOwnPropertyNames(n).reduce((acc, k) => ({...acc, [k]: n[k]}), {})
Insert cell
showInstanceValues = n => Object.getOwnPropertyNames(n.__proto__).reduce((acc, k) => ({...acc, [k]: n[k]}), {})
Insert cell
Insert cell
Insert cell
showValues(Object)
Insert cell
obj = ({a: 'A', b: 'B'})
Insert cell
showInstanceValues(obj)
Insert cell
Insert cell
Insert cell
showValues(Array)
Insert cell
arr = ['a', 'b', 'c', 'b']
Insert cell
showInstanceValues(arr)
Insert cell
Insert cell
Insert cell
showValues(Set)
Insert cell
s = new Set(['a', 'b', 'c', 'b'])
Insert cell
showInstanceValues(s)
Insert cell
Insert cell
Insert cell
showValues(Map)
Insert cell
m = new Map([['a', 'A'], ['b', 'B']])
Insert cell
showInstanceValues(m)
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