Platform
Resources
Pricing
Sign in
Get started
Ryan Murphy
Doing stuff
Workspace
Fork
Public
By
Ryan Murphy
Edited
Dec 6, 2022
Insert cell
Insert cell
function
square
(
n
)
{
return
n
*
n
;
}
Insert cell
test
(
(
)
=>
assert
.
equal
(
square
(
4
)
,
16
)
)
Insert cell
test
(
(
)
=>
{
assert
.
equal
(
square
(
4
)
,
20
)
;
}
)
Insert cell
test
(
(
)
=>
{
assert
.
equal
(
square
(
4
)
,
20
)
;
assert
.
equal
(
square
(
4
)
,
25
)
;
}
)
Insert cell
Insert cell
function
test
(
fn
)
{
try
{
fn
(
)
;
}
catch
(
error
)
{
if
(
error
instanceof
assert
.
Assertion
)
{
error
.
message
=
error
.
message
+
`\n`
+
error
.
details
;
}
throw
error
;
}
return
true
;
}
Insert cell
assert
=
import
(
"https://esm.sh/uvu/assert"
)
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
square
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
test
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
assert
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML