using advance TxSc, splats (inspired by CoffeeScript)
A Pen by Mink CBOS - Ephellon Dantzler on CodePen.
<script type=text/ts> | |
##!, strict mode required for advanced features | |
## +clean | |
## +eval | |
## +js-editor | |
## +legacy | |
## +math | |
## +wordy | |
## +advance | |
#gold, silver, rest. | |
$medals first, second, others... { | |
gold = first. | |
silver = second. | |
rest = others. | |
} | |
#contenders = ["Michael Phelps", "Liu Xiang", "Yao Ming", "Allyson Felix", "Shawn Johnson", "Roman Sebrle", "Guo Jingjing", "Tyson Gay", "Asafa Powell", "Usain Bolt"]. | |
medals(contenders...). | |
$doc.body.$html += ("<b gold>Gold</b>: <b name>${gold}</b><br/>"). | |
$doc.body.$html += ("<b silver>Silver</b>: <b name>${silver}</b><br/>"). | |
$doc.body.$html += ("<b other>Contenders</b>: <b name>${rest}</b><br/>"). | |
</script> |
<script src="http://codepen.io/Ephellon/pen/EVxVaJ.js"></script> |
body { | |
background: #000; | |
color: #fff; | |
font-family: arial, monospace; | |
} | |
b { | |
color: #ae94c0; | |
} | |
[gold] { | |
color: gold; | |
} | |
[silver] { | |
color: silver; | |
} | |
[other] { | |
color: #efc371; | |
} | |
[name] { | |
color: #dd925f; | |
} |
using advance TxSc, splats (inspired by CoffeeScript)
A Pen by Mink CBOS - Ephellon Dantzler on CodePen.