Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript面试题库 #10

Open
tjuking opened this issue Nov 14, 2015 · 0 comments
Open

JavaScript面试题库 #10

tjuking opened this issue Nov 14, 2015 · 0 comments

Comments

@tjuking
Copy link
Owner

tjuking commented Nov 14, 2015

  • 单线程
var flag = true;
setTimeout(function(){
    flag = false;    
}, 2000);
while(flag){
    //Do Something
}
console.log(flag);
  • 闭包
<ul>
    <li>click 1</li>
    <li>click 2</li>
    <li>click 3</li>
</ul>
var list = document.getElementsByTagName("li");
for(var i=0; i<list.length; i++){
    list[i].addEventListener("click", function(){
        alert(i);
    }, false);
}
  • 继承(实现Dog 继承 Animal
  • 如何实现将字符串转化成JSON对象?分析每种方法的优缺点
  • 反转字符串
  • 求数组最大值
  • 使用原生JavaScript封装一个方法 - 监听事件、执行回调函数
@tjuking tjuking changed the title JavaScript题库 JavaScript面试题库 Nov 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant