This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str1 = "http://www.google.tw/search?q=中文"; | |
obj = { | |
get a(){return '1';}, | |
set b(value){this.c = value;}, | |
c:1 | |
}; | |
class Cls{ | |
constructor(name){ | |
console.log("hello",name); | |
if (typeof(new.target)==='function') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"city": "New York", | |
"growth_from_2000_to_2013": "4.8%", | |
"latitude": 40.7127837, | |
"longitude": -74.0059413, | |
"population": "8405837", | |
"rank": "1", | |
"state": "New York" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementsByTagName('button')[0].onclick = function () { | |
scrollTo(document.body, 0, 1250); | |
} | |
function scrollTo(element, to, duration) { | |
var start = element.scrollTop, | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |