Public
Edited
Jul 23, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
burrito = ["chicken", 4.2, false, "avocado", 11.99, "beans"]
Insert cell
Insert cell
// Access the fourth element in burrito:

Insert cell
Insert cell
// Find the length of the burrito array:

Insert cell
Insert cell
// Find the index (position) of the value 4.2 in burrito:

Insert cell
Insert cell
Insert cell
Insert cell
droids = [
{name: "C-3PO", color: "gold", height: 167},
{name: "R2D2", color: "white/blue", height: 96},
{name: "BB-8", color: "white/orange", height: 26.4}
]
Insert cell
Insert cell
// Find the length of the droids array:

Insert cell
Insert cell
// Find the value of "height" for the third element in droids (BB-8's height):

Insert cell
Insert cell
// Find the keys of the first element in the droids array:

Insert cell
Insert cell
Insert cell
Insert cell
restaurantBills = [{bill: 49.51, tipPercent: 0.15},
{bill: 112.40, tipPercent: 0.22},
{bill: 68.25, tipPercent: 0.18},
{bill: 27.37, tipPercent: 0.12},
{bill: 50.18, tipPercent: 0.17}]
Insert cell
Insert cell
// Calculate tips for each bill here:

Insert cell
Insert cell
Insert cell
Insert cell
nyc_water = FileAttachment("nyc_water.csv").csv({typed: true})
Insert cell
nyc_water
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
// Access the third element in the array:

Insert cell
Insert cell
// Access Consumption (HCF) from the ninth element in the array:

Insert cell
Insert cell
// Access Location from the 100th element in the array:

Insert cell
Insert cell
// Use Array.map and an arrow array to return and array with the ratio of Current Charges to Consumption (HCF):

Insert cell
Insert cell
Insert cell
Insert cell
// Create and customize a scatterplot of Consumption (HCF) and Current Charges from the nyc_water data:

Insert cell
Insert cell
import { showMe } from "@observablehq/show-me"
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