Front-end Job Interview Questions
Front-end Job Interview Questions
前端面试
https://github.com/h5bp/Front-end-Developer-Interview-Questions
https://github.com/MaximAbramchuck/awesome-interview-questions
https://thatjsdude.com/interview/index.html
http://caibaojian.com/fedbook/practice/front-end-interview.html
柯里化函数
function curry(fn) {
var slice = [].slice;
var len = fn.length;
return function curried() {
var args = slice.call(arguments);
if (args.length >= len) {
return fn.apply(null, args);
}
return function () {
return curried.apply(null, args.concat(slice.call(arguments)));
};
};
}
var add = curry(function (a, b, c, d) {
return a + b + c + d;
});
console.log(add(1)(2)(3)(4)); // 10
console.log(add(1, 2, 3)(4)); // 10
console.log(add(1)(2, 3)(4)); // 10
https://segmentfault.com/q/1010000004342477
add(2)(5); // 7 & 柯里化 curry
js 实现, 函数 add(1)(2)(3); 无限极累加
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2019-01-01
*
* @description add & curry
* @augments
* @example
*
*/
function add( seed ) {
function retVal( later ) {
return add( seed + later );
}
retVal.toString = function() {
return seed;
};
return retVal;
}
console.log(add(1)(2)(3).toString());
// 6
console.log(add(1)(2)(3));
// ƒ 6
function addBug(a){
function s(b){
a = a+b;
return s;
}
s.toString = function(){return a;}
return s;
}
console.log(addBug(1)(2)(3)(4));
// ƒ 10
addBug(1);
// ƒ 1
let x = addBug(1)(2);
// ƒ 3
x;
// ƒ 3
alert(addBug(1)(2)(3)(4));
// alert: 10
// true

refs
https://llh911001.gitbooks.io/mostly-adequate-guide-chinese/content/ch4.html
https://www.cnblogs.com/pengchen/p/5434705.html
https://www.cnblogs.com/oxspirt/p/5436629.html
https://www.ruanyifeng.com/blog/2015/02/flexible-javascript.html
wat
https://www.destroyallsoftware.com/talks/wat


©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
Front-end Job Interview Questions的更多相关文章
- WCF学习系列二---【WCF Interview Questions – Part 2 翻译系列】
http://www.topwcftutorials.net/2012/09/wcf-faqs-part2.html WCF Interview Questions – Part 2 This WCF ...
- [译]Node.js Interview Questions and Answers (2017 Edition)
原文 Node.js Interview Questions for 2017 什么是error-first callback? 如何避免无止境的callback? 什么是Promises? 用什么工 ...
- WCF学习系列三--【WCF Interview Questions – Part 3 翻译系列】
http://www.topwcftutorials.net/2012/10/wcf-faqs-part3.html WCF Interview Questions – Part 3 This WCF ...
- WCF学习系列四--【WCF Interview Questions – Part 4 翻译系列】
WCF Interview Questions – Part 4 This WCF service tutorial is part-4 in series of WCF Interview Qu ...
- [转]Design Pattern Interview Questions - Part 4
Bridge Pattern, Composite Pattern, Decorator Pattern, Facade Pattern, COR Pattern, Proxy Pattern, te ...
- [转]Design Pattern Interview Questions - Part 2
Interpeter , Iterator , Mediator , Memento and Observer design patterns. (I) what is Interpreter pat ...
- [转]Design Pattern Interview Questions - Part 3
State, Stratergy, Visitor Adapter and fly weight design pattern from interview perspective. (I) Can ...
- [转]Design Pattern Interview Questions - Part 1
Factory, Abstract factory, prototype pattern (B) What are design patterns? (A) Can you explain facto ...
- 101+ Manual and Automation Software Testing Interview Questions and Answers
101+ Manual and Automation Software Testing Interview Questions and Answers http://www.softwaretesti ...
- 115 Java Interview Questions and Answers – The ULTIMATE List--reference
In this tutorial we will discuss about different types of questions that can be used in a Java inter ...
随机推荐
- Oracle的条件in中包含NULL时的处理
我们在写SQL时经常会用到in条件,如果in包含的值都是非NULL值,那么没有特殊的,但是如果in中的值包含null值(比如in后面跟一个子查询,子查询返回的结果有NULL值),Oracle又会怎么处 ...
- 有时间了解一下Spark SQL parser的解析器架构
1:了解大体架构 2:了解流程以及各个类的职责 3:尝试编写一个
- 路飞学城-Python开发集训-第5章
面向过程:核心是过程二字,过程是解决问题的步骤,相当于设计一条流水线,是机械式的思维方式 优点:复杂的问题流程化,进而简单化 缺点:可扩展性差 面向对象:核心是对象二字,对象就是特征与技能的结合体. ...
- maven install 错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-c ...
- mac python3 conda pytorch出错:libc++abi.dylib: terminating with uncaught exception of type NSException
mac 10.14/ conda/python 3.7环境下运行神经网络例子出现错误: -- :::] -[NSApplication _setup:]: unrecognized selector ...
- node.js之Cookie
最近还是用node.js比较多,今天正好遇见一个问题,还是关于Cookie. node.js中如何实现cookie(以express框架为例): "use strict"; var ...
- python:面向对象编程之Zope.interface安装使用
持续学习python+django中... 一.接口简述 在我们所熟知的面向对象编程语言中,大多提供了接口(interface)的概念.接口在编程语言中指的是一个抽象类型,是抽象方法的集合:它的特点如 ...
- day93之微信推送
python之微信推送详解 用什么推送 -邮件 -微信推送 -短信推送微信推送 -公众号(不能主动给用户发消息) -认证的公众号:需要营业执照,需要交钱,可以发多篇文章 - ...
- Nginx+IIS简单的部署
随着互联网项目用户访问量不断上升,单点web服务器是无法满足大型高并发高负载的业务处理的,为了给web服务器做负载均衡方案,打算采用Nginx搭建负载均衡服务器,把用户请求分配到N个服务器来缓解服务器 ...
- 【php增删改查实例】第二十六节 - 个人详情页制作
在一般的系统中,当用户点击头像的时候,就会跳转到对应的个人详情页,在这个页面,他可以查看和修改自己的个人信息,或者更换头像. 本案例中,个人详情页使用bootstrap框架. 首先,我们新建一个htm ...