Platform
Resources
Pricing
Sign in
Get started
Elizabeth Borneman
Workspace
Fork
Published
By
Elizabeth Borneman
Edited
Feb 19, 2019
Insert cell
Insert cell
Insert cell
Insert cell
earlyarray
=
[
"I"
,
"hope"
,
"this"
,
"works"
]
// Your code here
Insert cell
earlyarray
[
3
]
Insert cell
earlyarray
.
slice
(
0
,
2
)
Insert cell
earlyarray
[
4
]
=
"last"
//array[index of element to be changed]=new value
Insert cell
Insert cell
earlyarray
.
length
//length is a property of an array, and we used this format before to print properties i think
Insert cell
Insert cell
earlyarray
Insert cell
Insert cell
array1
=
[
'I'
,
'am'
,
'learning'
,
'Javascript'
,
'to'
,
'munge'
,
'large'
,
'datasets'
,
'and'
,
'visualize'
,
'them'
]
Insert cell
Insert cell
array1
.
join
(
)
//array1.join("")
// having a hard time doing this without some separator option
Insert cell
array1
.
reverse
(
)
Insert cell
array1
.
sort
(
)
Insert cell
array1
.
sort
(
function
(
a
,
b
)
{
return
a
.
toLowerCase
(
)
.
localeCompare
(
b
.
toLowerCase
(
)
)
;
}
)
;
Insert cell
array1
.
reverse
(
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ocean
=
(
{
place1location
:
"expansive"
,
place1name
:
"sevenofthem"
,
place1latititude
:
"1000"
,
place1longitude
:
"2000"
,
place1country
:
"borderingcountries"
}
)
//the first place and I gave it proporties.
Insert cell
mybed
=
(
{
place2location
:
"home"
,
place2name
:
"relaxingplace"
,
place2latititude
:
787
,
place2longitude
:
576
,
place2country
:
"whereverIam"
}
)
//the second place and I gave it proporties.
Insert cell
hierveelagua
=
(
{
place3location
:
"throughsmalltowns"
,
place3name
:
"boilingwater"
,
place3latititude
:
1010
,
place3longitude
:
1010
,
place3country
:
"Mexico"
}
)
//third place
Insert cell
jemezhotsprings
=
(
{
place4location
:
"inthemountians"
,
place4name
:
"hotsprings"
,
place4latititude
:
5454
,
place4longitude
:
454
,
place4country
:
"USA"
}
)
//fourthplace
Insert cell
mydreams
=
(
{
place5location
:
"somewhere"
,
place5name
:
"anywhere"
,
place5latititude
:
111
,
place5longitude
:
360
,
place5country
:
"somethingelse"
}
)
//fifthplace
Insert cell
listofplaces
=
[
ocean
,
mybed
,
hierveelagua
,
jemezhotsprings
,
mydreams
]
//an array that lists my five favorite places
Insert cell
myfavoriteplaces
=
(
{
listofplaces
}
)
//an object that contains an array that lists my five favorite places
Insert cell
//create OBJECT .. nameobj = ({})//
//create an array (Object) made of OBJECTS .. namearray = ["place1","place2"...]
//give each OBJECT in the array, a property.. place1 = ({location : "somewhere", name :"anywhere"})/\
//place2 = ({place2.location = somewhere, place2.name =anywhere, place2.latititude = something, place2.longitude= idk,place2.country = yep })
Insert cell
Insert cell
ocean
.
place1name
//name of the first place
Insert cell
mybed
.
place2name
//name of the second place
Insert cell
function
UpperCasefunction
(
namefirstplace
,
namesecondplace
)
{
return
namefirstplace
.
toUpperCase
(
)
;
return
namesecondplace
.
toUpperCase
(
)
}
//trying to get a function it to turn both place names into Uppercase letters. struggling
Insert cell
UpperCasefunction
(
ocean
.
place1name
,
mybed
.
place2name
)
//Can't figure out how to get it to print both of the names in one function
Insert cell
UpperCasefunction
(
mybed
.
place2name
,
mybed
.
place2name
)
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
earlyarray
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
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
Edit
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
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
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
ocean
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mybed
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
hierveelagua
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
jemezhotsprings
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mydreams
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
listofplaces
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myfavoriteplaces
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
UpperCasefunction
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML