From f11dc117ebb47d60267aeddf78666e5634d8fc81 Mon Sep 17 00:00:00 2001 From: Onoshko Dan Date: Sat, 19 Apr 2014 01:33:08 +0700 Subject: [PATCH] new demo --- demo.cola | 11 +++++++++-- lib/index.html | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/demo.cola b/demo.cola index 0650190d..c5edf4d6 100644 --- a/demo.cola +++ b/demo.cola @@ -9,18 +9,25 @@ function main(){ console.log("pow:", 5 ** 2, "; modulo:", 5 %% 3, ";"); - var a = 3.14, b = 584; + Number a = 3.14, b = 584, c; a ?= b; console.log(a); a = undefined; a ?= b; console.log(a); + console.log(a = c ? b); + c = 404; + console.log(a = c ? b); + + b = undefined; + console.log("a is {{isset a ? 'set' : 'undefiend'}}, b is {{b?? ? 'set' : 'undefined'}}"); + console.log(`is:`, location.href is String, `; isnt:`, 123 isnt Number, ";"); if(yes === true && on === true && no === false && off === false) console.log('Boolean alternatives'); console.log('Raw string:', r`@test \n \t \r`); - var isEmail = / + RegExp isEmail = / ([\w-\.]+) @ ((?:[\w]+\.)+) diff --git a/lib/index.html b/lib/index.html index ebceaad7..6df33c40 100644 --- a/lib/index.html +++ b/lib/index.html @@ -55,18 +55,25 @@ console.log("pow:", 5 ** 2, "; modulo:", 5 %% 3, ";"); - var a = 3.14, b = 584; + Number a = 3.14, b = 584, c; a ?= b; console.log(a); a = undefined; a ?= b; console.log(a); + console.log(a = c ? b); + c = 404; + console.log(a = c ? b); + + b = undefined; + console.log("a is {{isset a ? 'set' : 'undefiend'}}, b is {{b?? ? 'set' : 'undefined'}}"); + console.log(`is:`, location.href is String, `; isnt:`, 123 isnt Number, ";"); if(yes === true && on === true && no === false && off === false) console.log('Boolean alternatives'); console.log('Raw string:', r`@test \n \t \r`); - var isEmail = / + RegExp isEmail = / ([\w-\.]+) @ ((?:[\w]+\.)+)