Link Search Menu Expand Document

JavaScript

Setup

Types

Types Content
boolean true / false
number 123
string "hello"
array [1,2,["a","b"]]
object {"color":"red"}

Array

Transpose an array:

array = [ ["a", "b"],["c", "d"]]
array[0].map((_, colIndex) => array.map(row => row[colIndex]))

Functions

Simple test that return a JSON with true:

if (a === true ){
    return {b} ;
} else {
    // do something
}

Generate chars

Use Chart.js