Published
Edited
Feb 24, 2019
Insert cell
Insert cell
Insert cell
Insert cell
planets = ["pluto", "venus", "jupter","uranus"]

Insert cell
planets[2]
Insert cell
planets.slice(0,2)
Insert cell
{planets.push("last");
return planets;}
Insert cell
planets.length;
Insert cell
Insert cell
Insert cell
array1=['I', 'am', 'learning','Javascript','to','munge','large','datasets','and','visualize','them']
Insert cell
Insert cell
array1.join(" ");
Insert cell
array1.reverse();
Insert cell
array1.sort();
Insert cell
array1.sort(function (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
});
Insert cell
{array1.sort(function (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
})
array1.reverse();
return array1;}
;
Insert cell
Insert cell
html`My favorite colors:
<span style="background:#FF029F ;"> pink</span> /
<span style="color: #ffffff; background:black;"> black</span> /
<span style="background:#B78DD5;"> purple</span> /
<span style="background:#37E6F4;"> blue</span> /
<span style="background:SALMON;"> salmon</span>`
Insert cell
Insert cell
md`Date: <b>*${new Date(now).toLocaleDateString()}*</b>.`
Insert cell
md`Time: <b>*${new Date(now).toLocaleTimeString()}*</b>.`
Insert cell
Insert cell
FavePlaces = ({ "cities":[
{"location":"south america", "name":"brasilia", "lat":"15S", "lon":"47W", "country":"brazil"},
{"location":"europe", "name":"berlin", "lat":"52N", "lon":"13E", "country":"germany"},
{"location":"south america", "name":"sao paulo", "lat":"23S", "lon":"46W", "country":"brazil"},
{"location":"asia", "name":"bangkok", "lat":"13N", "lon":"100E", "country":"thailand"},
{"location":"europe", "name":"barcelona", "lat":"41N", "lon":"2E", "country":"spain"}
]});

Insert cell
Insert cell
function Upper(object1) {
var string2 =
((object1.cities[0].name).toUpperCase())
+", "+
((object1.cities[1].name).toUpperCase());
return string2;
}
Insert cell
Upper(FavePlaces);
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.
Learn more