Notebooks 2.0 is here.
Read the preview announcement
Platform
Resources
Pricing
Sign in
Get started
druchan
earthling
Workspace
Fork
Published
By
druchan
Edited
Apr 7, 2021
Insert cell
Insert cell
new
Set
(
[
1
,
2
,
2
,
3
,
3
,
3
]
)
Insert cell
Insert cell
Insert cell
mapSet
=
(
fn
)
=>
(
set
)
=>
{
let
newSet
=
new
Set
(
)
set
.
forEach
(
value
=>
newSet
.
add
(
fn
(
value
)
)
)
return
newSet
}
Insert cell
Insert cell
fn
=
a
=>
a
*
2
Insert cell
mapSet
(
fn
)
(
new
Set
(
[
1
,
2
,
2
,
3
,
3
,
3
]
)
)
Insert cell
Insert cell
Insert cell
mapSet2
=
fn
=>
set
=>
{
const
arrayFromSet
=
Array
.
from
(
set
)
const
mappedArray
=
arrayFromSet
.
map
(
fn
)
return
new
Set
(
mappedArray
)
}
Insert cell
Insert cell
mapSet2
(
fn
)
(
new
Set
(
[
1
,
2
,
2
,
3
,
3
,
3
,
4
,
4
,
4
,
4
]
)
)
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mapSet
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
fn
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mapSet2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML