Public
Edited
Dec 21, 2023
1 star
Insert cell
Insert cell
Insert cell
Array.fromAsync
Insert cell
Insert cell
{
let variable = 32;

variable = [1, "abc", 3];

variable[5] = [1, 2];

return variable[3];
}
Insert cell
Insert cell
{
let object = {
name: "zhangsan",
age: 12
};

object.age = 17;
object.grade = 90;

return object;
}
Insert cell
Insert cell
{
function add(a, b) {
return a + b;
}

let mul = (a, b) => {
return a * b;
};

return mul("ABC", 2);
}
Insert cell
Insert cell
{
const print = console.log;

function Animal(name) {
this.name = name;
}

Animal.prototype.getName = function() {
return this.name;
};

const animal = new Animal("page");

return {
1: animal,
2: animal.__proto__ === Animal.prototype,
3: animal.prototype,
4: Animal.prototype,
5: Object.getOwnPropertyNames(Animal),
6: Animal.length,
7: Animal.name,
8: Object.getOwnPropertyNames(Animal.prototype),
9: Object.getOwnPropertyNames(animal.__proto__)
};
}
Insert cell
{
const print = console.log;

const obj = {};

return {
1: obj,
2: obj.__proto__ === obj.prototype,
3: obj.prototype,
4: obj.prototype,
5: Object.getOwnPropertyNames(Object),
6: Object.getOwnPropertyNames(Object.prototype),
7: Object.prototype.__proto__
};
}
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