Published
Edited
May 9, 2020
Insert cell
md`# Fun with JavaScript proxies`
Insert cell
function makeProxy(stopWords) { return new Proxy({}, { get(obj, prop) { return stopWords.includes(prop) ? 'I know.' : makeProxy(stopWords) } }) }
Insert cell
hey = makeProxy(['cool', 'awesome'])
Insert cell
hey.this.is.really.cool
Insert cell
hey.ecmaScript.is.awesome
Insert cell
hey.this.is.a.test
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