Platform
Resources
Pricing
Sign in
Get started
Carlos Sandoval Olascoaga
Big walls, cities, computing, and design.
Workspace
Fork
Public
4.182 PSET Solutions
By
Carlos Sandoval Olascoaga
Edited
Feb 23, 2023
Fork of
PSET 2
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const
myArray
=
[
"Hello"
,
"my"
,
"name"
,
"is"
]
let
arrayLength
=
myArray
.
length
return
arrayLength
}
Insert cell
array1
=
[
'I'
,
'am'
,
'learning'
,
'Javascript'
,
'to'
,
'munge'
,
'large'
,
'datasets'
,
'and'
,
'visualize'
,
'them'
]
Insert cell
Insert cell
Insert cell
Insert cell
// Make an object with array of places (each place has loc, name, lat, long), and a method to return that array.
topPlaces
=
(
{
places
:
[
{
// an array named places, with 5 objects
location
:
"NY"
,
name
:
"New York"
,
latlon
:
[
42
,
72
]
}
,
{
location
:
"SF"
,
name
:
"San Francisco"
,
latlon
:
[
55
,
34
]
}
,
{
location
:
"BS"
,
name
:
"Boston"
,
latlon
:
[
42
,
64
]
}
]
,
getTops
:
function
(
)
{
return
[
this
.
places
[
0
]
.
name
.
toUpperCase
(
)
,
this
.
places
[
1
]
.
name
.
toUpperCase
(
)
]
}
,
getLow
:
function
(
)
{
return
this
.
places
[
this
.
places
.
length
-
1
]
.
name
.
toUpperCase
(
)
}
}
)
Insert cell
Insert cell
topPlaces
.
getLow
=
function
(
)
{
return
this
.
places
[
-
1
]
.
name
.
toUpperCase
(
)
}
Insert cell
topPlaces
.
places
.
push
(
{
location
:
"NY"
,
name
:
"New York"
,
latlon
:
[
42
,
72
]
}
)
Insert cell
topPlaces
.
getLow
(
)
Insert cell
topPlaces
.
getTops
(
)
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
Compare fork
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
Edit
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
array1
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
topPlaces
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
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