Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Javascript interview ====== ===== Javascript ===== ==== 問答題 ==== Reference: https://stackoverflow.com/questions/1684917/what-questions-should-a-javascript-programmer-be-able-to-answer <note> [[https://jsfiddle.net/questwork/ttmyG/|Why would this code not work as expected? Is anything missing?]] <code> class User { constructor(name) { this.name = name; } } </code> </note> <note> [[https://jsfiddle.net/questwork/72pHB/|Why does it alert undefined when I declared the jack variable to be 'Jack'?]] </note> <note> [[https://jsfiddle.net/questwork/Ge9ta/|What will this code alert? Why?]] </note> <note> [[https://jsfiddle.net/questwork/6QppX/|Why does the second alert say undefined?]] </note> <note> [[http://jsfiddle.net/questwork/qj2z7/|Why do the anchors, when clicked on, alert -1 instead of their respective counter inside of the loop?]] http://jsrun.net/QpbKp/edit The difference is scoping. var is scoped to the nearest function block and let is scoped to the nearest enclosing block. </note> * Function.prototype.apply() 是什麼呢? * ES6 跟 ES5 有什么差别?请以代码举例。 * What is JSON? * Explain MVC * 什么是 Callback? * 什么是 Promise? * Callback 跟 Promise 有什么差别?请举例。 * 什么是设计模式 Design Pattern?请指出三个设计模式并以代码说明其中一个。 ==== 習作題 ==== <note> 數列 http://jsfiddle.net/questwork/nfb7B/ </note> ===== NodeJS ===== <note> Node.js event loop reference: https://blog.risingstack.com/node-js-at-scale-understanding-node-js-event-loop/ https://jsfiddle.net/questwork/10497gs8/ </note> ===== MongoDB ===== 假设你要做一个图书管理系统。你会怎样设计 MongoDB document 以达到以下需求? * 读者能以作者姓名丶分类丶书名丶出版社丶年份找书籍。 * 请写出以作者姓名或书名的 Query? ===== Framework ===== * 有没有使用 Node.js + Express + MongoDB + Mongoose 的经验?请举例。 * 有没有使用 oAuth 及 Passport.js 的经验?请举例。 * 有没有使用 Backbone.js 的经验?什么是 Model, View?请举例。 * 有没有使用 ReactJS 的经验?请举例。 interview/developer/javascript/start.txt Last modified: 2019/07/11 21:36by don.lee