Public
Edited
Apr 13, 2024
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Print every element in an array. <br> ${((iArray)=>{
return iArray.join('<br>');
}
)(infoArray)}
Insert cell
Loop through an Array Object.<br> ${
infoArray.join('<br>')
}.
Insert cell
infoArray = {
let fruitStrs = [];
fruits.forEach( (fruit, i) => {
fruitStrs.push(i + 'th element is ' + fruit);
console.log(i + 'th element is ' + fruit);
});
return fruitStrs;
}
Insert cell
{
var hour = null;// = 1/4;
return myData + ' is here at ' + hour;
}
Insert cell
myData = {
var f_Name = 'Dolly', lName = "Adams";

return f_Name + ' ' + lName;
}
Insert cell
{
var person = {"first Name":"John", lastName:"Doe", age:50, eyeColor:"blue"};
return person;
}
Insert cell
Insert cell
Insert cell
viewof listItems = listInput({value:fruits})
Insert cell
listItems
Insert cell
Insert cell
Insert cell
function soundexes(names) {
return(names.trim().split(',').map(x => soundex(x.trim())));
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
formatNameSeries = function (names) {
if(names.length < 1) return '';
if(names.length == 1) return names[0];
if(names.length == 2) return names[0] + ' and ' + names[1];
let lName = names.pop();
return names.join(', ') + ', and ' + lName;
}
Insert cell
{
let nm = ['apple', 'orange', 'banana'];
return formatNameSeries(nm);
//return nm.at(-1);
}
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