interesting js
[5/3/2016 4:18 PM] Calos Chen:
function a(b,e){var a=0;a+=b;if(e){console.log(b+e);return;} return function(c){a+=c;console.log(a)}} output: a(2,3) 5
a(2,3) 5
两种写法结果一样 a(2,3)和a(2)(3)
interesting js的更多相关文章
- 【腾讯Bugly干货分享】WebVR如此近-three.js的WebVR示例解析
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/57c7ff1689a6c9121b1adb16 作者:苏晏烨 关于WebVR 最 ...
- (翻译)《Hands-on Node.js》—— Why?
事出有因 为何选择event loop? Event Loop是一种推进无阻塞I/O(网络.文件或跨进程通讯)的软件模式.传统的阻塞编程也是用一样的方式,通过function来调用I/O.但进程会在该 ...
- You Don't Know JS: Scope & Closures(翻译)
Chapter 1: What is Scope? 第一章:什么是作用域 One of the most fundamental paradigms of nearly all programming ...
- js 性能基准测试工具-告别可能、也许、大概这样更快更省
平时写js经常遇到这样做是不是更快点?但又没有具体简单可测试的工具,最近也倒序看博客园司徒正美 js分类下的文章 [ps:去年灵光一闪,发现看博客园排名前100的博客.按照文章分类倒序看是学习最快的方 ...
- 如何使用impress.js做一个网页版本的PPT
blockquote{font-size: 18px;line-height:1.5;margin:0;}line-height: 1.5; 要做一个网站制作规范培训,之前村长做过一次培训,但是后来一 ...
- Understanding Asynchronous IO With Python 3.4's Asyncio And Node.js
[转自]http://sahandsaba.com/understanding-asyncio-node-js-python-3-4.html Introduction I spent this su ...
- three.js 简介
What is Three.js? Let's try to describe it briefly: Three.js is a library that makes WebGL - 3D in t ...
- JS内存泄漏 和Chrome 内存分析工具简介(摘)
原文地址:http://web.jobbole.com/88463/ JavaScript 中 4 种常见的内存泄露陷阱 原文:Sebastián Peyrott 译文:伯乐在线专栏作者 - AR ...
- 奇怪的JS正则之 /[A-z]/.test("\\"); // true
本文是在一个国外介绍JS的网站上转载过来的,作者很逗,先是举例JS让人XX的例子,再动手实践发现JS隐藏的黑知识.为什么 /[A-z]/.test("\\"); 是 true ,你 ...
随机推荐
- linux卸载php
卸载: rpm -qa | grep php 所以正确的卸载顺序是:# rpm -e php-mysql-5.1.6-27.el5_5.3 --allmatches #同名全部卸载# rpm -e ...
- C++ 栈和队列
使用标准库的栈和队列时,先包含相关的头文件 #include<stack> #include<queue> 定义栈如下: stack<int> stk; 定义队列如 ...
- Delphi 缩放图像代码 - 支持PNG透明通道
要求Delphi2007或者更高版本, 系统要求至少XP-SP2以上 实际上是利用了Windows的windowscodecs.dll这个文件的功能 在VCL里已经封装为TWICImage类 proc ...
- NSArry的常见方法
使用数组对象创建的数组功能非常强大,在Java语言或者C语言中定义的数组必须满足数组中的每一个元素必须是同样的类型.而Objective-C语言可以在Array数组中放任意类型的数据,值得注意的是只能 ...
- Java实验报告二:Java面向对象程序设计
Java实验报告二:Java面向对象程序设计 ...
- php--yii2.0框架的curl
yii2.0框架的增删改查 //插入操作 save() $customer=new Customer(); $customer->name=‘小熊‘; $customer->save() ...
- 1058 N的阶乘的长度
1058 N的阶乘的长度 基准时间限制:1 秒 空间限制:131072 KB 输入N求N的阶乘的10进制表示的长度.例如6! = 720,长度为3. Input 输入N(1 <= N <= ...
- [LeetCode] Substring with Concatenation of All Words(good)
You are given a string, S, and a list of words, L, that are all of the same length. Find all startin ...
- How To Install Tinc and Set Up a Basic VPN on Ubuntu 14.04
Introduction In this tutorial, we will go over how to use Tinc, an open source Virtual Private Netwo ...
- Scrambled Polygon---poj2007(利用叉积排序)
题目链接:http://poj.org/problem?id=2007 题意:乱序给出凸多边形的顶点坐标,要求按逆时 针顺序输出各顶点.给的第一个点一定是 (0,0),没有其他点在坐标轴上,没有三点 ...