Notebooks 2.0 is here.
Read the preview announcement
Platform
Resources
Pricing
Sign in
Get started
myProject
Workspace
Fork
Public
By
zangyubo
Edited
Feb 9
Insert cell
Insert cell
Insert cell
{
function
Person
(
name
)
{
this
.
name
=
name
;
}
class
PersonCopy
{
constructor
(
name
)
{
this
.
name
=
name
;
}
sayName
(
)
{
return
this
.
name
}
}
const
person
=
new
PersonCopy
(
"bob"
)
;
return
[
person
,
typeof
PersonCopy
]
}
Insert cell
// 每个实例都有一个副本
{
function
Person
(
name
)
{
this
.
name
=
name
;
this
.
greet
=
function
(
)
{
console
.
log
(
`Hello, my name is ${
this
.
name
}`
)
;
}
;
}
const
p1
=
new
Person
(
"Alice"
)
;
const
p2
=
new
Person
(
"Bob"
)
;
return
[
p1
,
p2
]
;
}
Insert cell
{
function
Person
(
name
)
{
this
.
name
=
name
;
}
return
[
Object
.
getOwnPropertyDescriptors
(
Person
.
prototype
)
]
;
}
Insert cell
{
function
person
(
name
)
{
return
"My name is "
+
name
;
}
return
[
Object
.
getOwnPropertyDescriptors
(
person
)
]
}
Insert cell
{
function
Person1
(
name
)
{
this
.
name
=
name
;
}
class
Person2
{
constructor
(
name
)
{
this
.
name
;
}
}
}
Insert cell
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
Edit
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
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML