function doStuff (x, y, z) { }
var args = [0, 1, 2];
doStuff(...args);function doStuff(x, y, z) {} var args = [0, 1, 2];
| /* bling.js */ | |
| window.$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function (name, fn) { | |
| this.addEventListener(name, fn); | |
| } | |
| NodeList.prototype.__proto__ = Array.prototype; | 
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| </head> | |
| <body> | |
| <script> | |
| if ("geolocation" in navigator) { | |
| navigator.geolocation.getCurrentPosition(function(position) { | 
| { | |
| "1": 0.094, | |
| "1.5": 0.135137432, | |
| "2": 0.16639787, | |
| "2.5": 0.192650919, | |
| "3": 0.21573247, | |
| "3.5": 0.236572661, | |
| "4": 0.25572005, | |
| "4.5": 0.273530381, | |
| "5": 0.29024988, | 
| // ref: http://stackoverflow.com/a/16265811 | |
| // 用 createRange 創一新的選擇範圍來判斷圈選的方向性 | |
| // anchorNode 是開頭圈選的 node, focusNode 是停止圈的位置 | |
| // 當圈選起始點在後面,那這個生成的 range 會壓縮成一個疊合的位置,`range.toString()` 時會變成空字串 '' | |
| // 不過我這邊調整了一下,直接輸出 rg.collapsed 比較原生,不用再轉一次 `toString()` | |
| function isBackwards (sel) { | |
| var rg = document.createRange(); | |
| rg.setStart(sel.anchorNode, sel.anchorOffset); | |
| rg.setEnd(sel.focusNode, sel.focusOffset); | |
| return rg.collapsed; | 
| { | |
| "pokemon": { | |
| "1": { | |
| "name": "Bulbasaur", | |
| "types": [ | |
| "grass", | |
| "poison" | |
| ], | |
| "cpPerUpgrade": 13.5, | |
| "evolveCost": "25", | 
| console.log(123); | |
| let pokeInfo = [ | |
| { | |
| "id": 150, | |
| "name": "Mewtwo", | |
| "type": "psychic", | |
| "cpPerLv": 60, | |
| "maxcp": 4144 | |
| }, | |
| { | 
| [ | |
| { | |
| "id": 150, | |
| "name": "Mewtwo", | |
| "type": "psychic", | |
| "cpPerLv": 60, | |
| "maxcp": 4144 | |
| }, | |
| { | |
| "id": 149, | 
| // once in the headers | |
| defineMetaEvent('Namespace','Click'); | |
| // then when you need it | |
| document.body.onNamespaceClick.add(function(e) { /*...*/ }); | |
| document.body.onNamespaceClick.clear(); | 
| <div id="map-container" class="side-content"> | |
| <div id="map-content" data-lat=25.0327429 data-lng=121.5668311 style="width:620px; height: 400px;" class="map-wrapper"> | |
| </div> | |
| </div> | |
| <!-- then… --> | |
| <div id="map-container" class="side-content"> | |
| <div id="map-content" data-lat=25.0327429 data-lng=121.5668311 style="width:620px; height: 400px;" class="map-wrapper"> | |
| <noscript> | |
| <img src="https://maps.googleapis.com/maps/api/staticmap?center=25.0327429,121.5668311&zoom=16&size=620x400&markers=25.0327429,121.5668311"> |