Published
Edited
Feb 6, 2018
5 stars
Insert cell
Insert cell
Insert cell
arr1 = [ 1, 2, 3, 4, 5 ]
Insert cell
Insert cell
str = JSON.stringify( arr1 )
Insert cell
Insert cell
arr2 = JSON.parse( str )
Insert cell
Insert cell
Insert cell
Insert cell
stdlib = require( "https://unpkg.com/@stdlib/stdlib@0.0.32/dist/stdlib-flat.min.js" )
Insert cell
Insert cell
Insert cell
Insert cell
err1 = new Error( 'beep' )
Insert cell
Insert cell
str1 = JSON.stringify( err1 )
Insert cell
Insert cell
obj1 = JSON.parse( str1 )
Insert cell
Insert cell
Insert cell
obj2 = stdlib.error2json( err1 )
Insert cell
Insert cell
str2 = JSON.stringify( obj2 )
Insert cell
Insert cell
err2 = JSON.parse( str2, stdlib.reviveError )
Insert cell
Insert cell
Insert cell
err3 = new TypeError( 'boop' )
Insert cell
Insert cell
str3 = JSON.stringify( stdlib.error2json( err3 ) )
Insert cell
Insert cell
err4 = JSON.parse( str3, stdlib.reviveError )
Insert cell
Insert cell
Insert cell
Insert cell
arr3 = new Float64Array( [ 1, 2, 3, 4, 5 ] )
Insert cell
Insert cell
str4 = JSON.stringify( arr3 )
Insert cell
Insert cell
obj3 = JSON.parse( str4 )
Insert cell
Insert cell
obj4 = stdlib.typedarray2json( arr3 )
Insert cell
Insert cell
str5 = JSON.stringify( obj4 )
Insert cell
Insert cell
arr4 = JSON.parse( str5, stdlib.reviveTypedArray )
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
z1 = new stdlib.Complex128( 3.14, -2.0 )
Insert cell
Insert cell
str6 = JSON.stringify( z1 )
Insert cell
Insert cell
obj5 = z1.toJSON()
Insert cell
Insert cell
str7 = JSON.stringify( obj5 )
Insert cell
Insert cell
z2 = JSON.parse( str7, stdlib.reviveComplex )
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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