Platform
Resources
Pricing
Sign in
Get started
Benjamin Atkin
A software developer working on tools for API integrations. Interests: running, reading, music
Workspace
Fork
Published
By
Benjamin Atkin
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.
Try it for free
Learn more
Fork
View
Export
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
makeProxy
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
hey
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML