Published
Edited
Jan 31, 2020
Fork of Untitled
2 forks
Importers
16 stars
Insert cell
Insert cell
Insert cell
cljs `(range 10)`
Insert cell
cljs `[1]`
Insert cell
cljs `{:a 1}`
Insert cell
cljs `(map inc (range 10))`
Insert cell
cljs `(clojure.string/join ["a" "b"])`
Insert cell
cljs `(clojure.string/join (reverse "reppot nee si seeK"))`
Insert cell
Insert cell
pow = cljs `(fn [x n] (reduce (fn [acc _] (* acc x)) 1 (range n)))`
Insert cell
pow(10, 2) + 20
Insert cell
Insert cell
xf = cljs `(comp (map inc) (map (partial * 20)))`
Insert cell
cljs(`(into [] xf (range 10))`, {xf: xf})
Insert cell
Insert cell
cljs = function(...args) {
// Depending on the usage `` or () args is an array of arrays or a an array of strings
var code, context, s = args[0];
if (s && typeof s.valueOf() === "string") {
code = args[0], context = args[1];
} else {
code = args[0][0];
}

return sci.toJS(sci.evalString(code, {bindings: context}));
}
Insert cell
sci = require("@borkdude/sci")
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