(Still) concept for run json as native js. JSON must be valid json-script-syntax object.
var root = this;
["var", {"root": "this"}]
[
{
"var": {
"a": 10,
"b": {"calc": ["a","*",10]},
// or
"c": {"calc": "(a+b)/3"},
"d": {"require": "gulp-load-plugins"}
}
}
}
]
(function(root) {
var timer = {
_startTimer: function() {
if (!this._timer)
this._timer = setTimeout()
}
start: function(reset) {
reset && this.reset();
this._startTimer();
}
}
})( window || (module || null) );