08 2017 档案
摘要:题目: Part of Series 1/3 This kata is part of a series on the Morse code. After you solve this kata, you may move to the next one. 系列的一部分,1/3 这个形是莫尔斯电码系
阅读全文
摘要:题目: A square of squares You like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange the
阅读全文
摘要:javascript面试题:如何把一句英文每个单词首字母大写?
js中prototype用法
阅读全文
摘要:题目: Generators can be used to wonderful things. You can use them for numerous things, but here is one specific example. You are studying for a test so
阅读全文
摘要:官网:http://www.css88.com/doc/webpack2/concepts/ webpack是js的模块打包器(module bundler)。 入口(Entry) webpack将创建所有应用程序的依赖关系图标(dependency graph)。 入口起点(entry point
阅读全文
摘要:全局变量:启动脚本了.在各线程,以及主程序中.可以互相传递值.每次启动脚本,初始值都一样.环境变量:启动脚本了.在各线程,以及主程序中.可以互相传递值.每次启动脚本,初始值是上次停止脚本时的值. 例子:Global 全局变量Dimenv 环境变量全局变量 = 全局变量 + 1环境变量 = 环境变量
阅读全文
摘要:开发步骤 1、下载node 2、下载webpack npm install webpack -g 3、安装脚手架 npm install vue-cli -g 4、根据模板创建项目 simple 完全没用 webpack-simple 用他 webpack 有校验 browserify-simple
阅读全文
摘要:Sass官网: http://www.w3cplus.com/sassguide/ sass: 预处理语言; Ruby语言,即使不懂Ruby,也是可以使用sass 文件后缀名 文件后缀名 sass有两种后缀名文件:一种后缀名为sass,不使用大括号和分号;另一种就是我们这里使用的scss文件,这种和
阅读全文
摘要:题目: 【JS排序】var str = "1245242"; //这是数组 要求从出现次数多到少排序示例结果:2:3,4:2,1:1,5:1【2出现3次,4出现2次...】 答案:
阅读全文
摘要:题目: Given an array of one's and zero's convert the equivalent binary value to an integer. Eg: [0, 0, 0, 1] is treated as 0001 which is the binary repr
阅读全文
摘要:题目: The objective of 'Duck, duck, goose' is to walk in a circle, tapping on each player's head until one is finally chosen. Task: Given an array of Pl
阅读全文
摘要:题目: Deferring a function execution can sometimes save a lot of execution time in our programs by postponing the execution to the latest possible insta
阅读全文
摘要:题目: Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before, or after the addition. The
阅读全文
摘要:题目: You probably know the "like" system from Facebook and other pages. People can "like" blog posts, pictures or other items. We want to create the te
阅读全文
摘要:题目: The new "Avengers" movie has just been released! There are a lot of people at the cinema box office standing in a huge line. Each of them has a si
阅读全文
摘要:题目: Your task is to write a higher order function for chaining together a list of unary functions. In other words, it should return a function that do
阅读全文
摘要:题目: Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you
阅读全文
摘要:题目: You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N
阅读全文
摘要:var testFun = function( callback,lblstr ){ //callback 是你的方法 lblstr做标记的名称,测试字符串在函数内部。如有错误,自行改正。。切勿打脸(测试代码来源网上) var teststr = '3345687687876789123'; var
阅读全文
摘要:1.http://davidshariff.com/js-quiz/ 难度正常 2.http://perfectionkills.com/javascript-quiz/ --略虐心 3.http://perfectionkills.com/javascript-quiz-es6/ --没看过es6
阅读全文
摘要://链接:http://cnodejs.org/topic/580743a627a1d99178a98fc5 1.求输出: ([]+![])[+!![]] //a 2.求输出//评论里的问题 同计算了 ((-{})+[])[+![]]//N 解析: //虽然平时没看到有这么用的 代码里这么写的要么是
阅读全文
摘要:1.能FQ的人类 可以参考如下链接(遍历过十几个相关的文章 觉得这个算不错的) https://davidwalsh.name/combining-js-arrays 2.不能FQ的可以参考 简略翻译。。 对于数组 var a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; var
阅读全文
摘要:1.实现add add(123, "321") "444"; add("1234567890.0987654321", "8765432109.9012345678") "9999999999.9999999999"; add("1.2.3", 1.23); NaN; add(0.1, 0.0001
阅读全文
摘要:1.题目一: pattern(3): 1 1*2 1**3 pattern(10): 1 1*2 1**3 1***4 1****5 1*****6 1******7 1*******8 1********9 1*********10 pattern函数编写: 2.题目二: Ex. 123456 -
阅读全文
摘要:1.实现MagicFunction MagicFunction(3) == 3; // should return true MagicFunction(1, 2) == 3; // should return true MagicFunction(1, 3)(2) == 6; // should
阅读全文
摘要:1.实现函数--defaultArguments 功能如下: function add(a,b) { return a+b;}; var add_ = defaultArguments(add,{b:9}); add_(10); // returns 19 add_(10,7); // return
阅读全文
摘要:1.实现warp function speak(name){ return "Hello " + name; } speak = speak.wrap(function(original, yourName, myName){ greeting = original(yourName); retur
阅读全文
摘要:1.实现如下代码功能 var deps = { 'dep1': function () {return 'this is dep1';}, 'dep2': function () {return 'this is dep2';}, 'dep3': function () {return 'this
阅读全文
摘要:1.实现如下函数 f3 = compose( f1 f2 )//f3(a) = f1( f2( a ) ); eg: compose(f , g)(x) => f( g( x ) ); 2.题目1 完全没思路的 下拉到底。 给你个极简参考: function compose(f,g) { retur
阅读全文
摘要:1.实现斐波那契数列。达到题目中的效果。不知道斐波那契数列是啥的请自行百度。 function fibonacci(){ } var f=fibonacci(); for(var i=0;i<10;i++){ console.log(f()); } //output:按顺序输出斐波那契数列的数字。
阅读全文
摘要:1.这些题也是秀智商 window.alert = function(){}; //your code; alert(1); //使后面的alert(1)能正确弹出 答案: window.alert = function(){}; window.alert=function(obj){ var if
阅读全文
摘要:题目1: 获取正在执行的script元素标签。 //by 司徒正美 function getInteractiveScript(){ if(document.currentScript){ return document.currentScript; } var els = document.get
阅读全文
摘要:1. var value1 = 0, value2 = 0, value3 = 0; for ( var i = 1; i <= 3; i++) { var i2 = i; (function() { var i3 = i; setTimeout(function() { value1 += i;
阅读全文
摘要:1.CORS和JSONP区别? 2.如何规避同源策略? eg:访问iframe 3.如何实现 一个算法的不变的部分,并将可变的行为留给子类来实现 简单写一个demo
阅读全文
摘要:1.原型式继承与类式继承的区别? 2.用JS写一个单例,并注释为什么这么写。 3.(不考虑ES6),如何有效的控制作用域(也可以是控制this指向)?比如:with 4.JS 数组去重。
阅读全文
摘要:1.给定数组a和数组b,如何将数组b append到数组a尾端? 2.基于题目1的情况 如果a数组和b数组均是长度小于100 你觉得那那种方式最优? 3.基于题目1的情况,如果a数组长度与b数组差异较大 比如a数组的长度为5,b数组长度为10k, 你觉得那种方式最优? 4.js的push允许单个元素
阅读全文
摘要:1. 实现下列语法 console.log(sum(2,3)); // Outputs 5 console.log(sum(2)(3)); // Outputs 5 答案:这道题,不解释,因为之前的问题里解答过。 知识点:javascript 函数柯里化 另外要加上形参判断。arguments.le
阅读全文
摘要:所有问题都是问结果及why? 1. delete [].length; false,知识点第一个在于delete能删除和不能删除什么 面试问过;var声明的变量可否删除,window的自定义属性和给定的属性 可不可以删除? 2. vars: var vars = vars; 冒号 在js里可以当做l
阅读全文
摘要:1. 为什么井盖是圆的? 2. 用一两句话,向你8岁大的小孩解释一个数据库 3. 向一位盲人形容黄色 4. 朋友圈的基本数据结构设计是怎样的?既能做到完美阅读权限设置,又能兼顾性能? 5. 朋友圈的消息为啥不能编辑,只能删除?
阅读全文
摘要:1. var lowerCaseOnly = /^[a-z]+$/; [lowerCaseOnly.test(null), lowerCaseOnly.test()] 答案:有关正则表达式,test过程会将传入的变量自动转换为字符串 null-》"null",完全没有则会转换为"undefined"
阅读全文
摘要:1. []==[] 答案:false. 数组,在 Javascript 中是对象,对象使用 == 比较都是比较的引用。 简单的说,就是,如果是同一个对象,就相等,如果不是同一个对象,就不等。 每次使用 [] 都是新建一个数组对象,所以 [] == [] 这个语句里建了两个数据对象,它们不等。 2.
阅读全文
摘要:1. var f = true; if (f true) { var a = 10; } function fn() { var b = 20; c = 30; } fn(); console.log(a); console.log(b); console.log(c); 2. var x = 1;
阅读全文
摘要:1. function() { var a = 10; if(a > 5) { a = 7; } alert(a); } 2. function() { if(true) { var a = 5; } alert(a); } 3. var a = 5; function first() { a =
阅读全文
摘要:1. var foo = function foo() { console.log(foo foo); }; foo(); 2. Number("1") - 1 == 0; 3. (true + false) > 2 + true; 4. function bar() { return foo; f
阅读全文
摘要:1 (function(){ return typeof arguments; })(); 答案:object 知识点:typeof返回的六种类型,boolean,object,undefined,string,number,function(追问:typeof null 输出) arguments
阅读全文
摘要:1. (function(x, f = () => x) { var x; var y = x; x = 2; return [x, y, f()]; })(1) 2. (function() { return [ (() => this.x).bind({ x: 'inner' })(), (()
阅读全文
摘要:1.输出结果和原因 console.log(a); // undefined console.log(b); // b is not defined window.b = 10; var a = 20; 2.函数表达式和函数声明的特点。 如果不声明函数名称,一定是表达式 ;如果声明名称,要通过上下文
阅读全文
摘要:1.两个function区别 function foo1() { return { // 返回对象{}留有一个大括号跟return在同一行 bar: "hello" }; } function foo2() { return { // {}没跟return同一行,所以返回的是undefined ba
阅读全文
摘要:题目: A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits. For example, take 153 (3 d
阅读全文

浙公网安备 33010602011771号