码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
JS call与apply
JS的call与applycall和apply是JS中比较重要的两个方法, 一般在框架和组件设计中用的较多,比如jQuery Code。 那么这两个方法是做什么的呢,下面我们通过代码来了解:1 function f(){2 console.log(this.name);3 }4 5 ...
分类:移动开发   时间:2015-12-12 20:15:53    阅读次数:227
随机数
随机数:function randomString(length){ length = length || 32; var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789'; var maxPos = chars.len...
分类:其他好文   时间:2015-12-12 20:15:21    阅读次数:115
hdu 4686 Arc of Dream(矩阵快速幂乘法)
Problem DescriptionAn Arc of Dream is a curve defined by following function:wherea0 = A0ai = ai-1*AX+AYb0 = B0bi = bi-1*BX+BYWhat is the value of AoD(...
分类:其他好文   时间:2015-12-12 17:10:34    阅读次数:196
js实现归并排序
function merge(s_arr, d_arr, start, middle, end){ var s_temp = start; var m_temp = middle+1; var temp; var d = start; for(;s_temp <= mi...
分类:编程语言   时间:2015-12-12 16:50:20    阅读次数:174
【5_283】Move Zeroes
终于碰到一道水题,睡觉去~Move ZeroesTotal Accepted:37369Total Submissions:88383Difficulty:EasyGiven an arraynums, write a function to move all0's to the end of it...
分类:其他好文   时间:2015-12-12 16:49:55    阅读次数:115
JavaScript深入理解函数 - 函数的传值
在JavaScript中,由于函数名就是一个变量,所以函数也可以作为值来使用。我们不仅可以像传递参数一样把一个函数传递给另一个函数,还可以将一个函数作为另一个函数的返回值返回。 将函数作为参数传递由于函数是对象,所以可以直接把函数作为参数来传递。来看下面的例子://定义一个函数function sa...
分类:编程语言   时间:2015-12-12 15:24:53    阅读次数:245
[Linked List]Delete Node in a Linked List
otal Accepted:48115Total Submissions:109291Difficulty:EasyWrite a function to delete a node (except the tail) in a singly linked list, given only acce...
分类:其他好文   时间:2015-12-12 15:20:16    阅读次数:119
web worker使用
使用postMessage()方法传递信息。来自Worker的数据保存在event.data中。通过message和error事件与页面通信。stufftodo.js文件内容如下://self引用worker对象self.onmessage = function(event){ var dat...
分类:Web程序   时间:2015-12-12 13:58:53    阅读次数:141
nodejs初探(二)第一个nodejs程序“hello world”
直接用文本编辑器编写helloworld.js,保存在桌面var http = require("http");http.createServer(function(request, response) { response.write("Hello World"); resp...
分类:Web程序   时间:2015-12-12 12:36:12    阅读次数:178
Cookie保存用户名和账户密码
cookiesRemember.js//得到最后登录的用户function GetLastUser() { var id = "49BAC005-7D5B-4231-8CEA-16939BEACD67";//GUID标识符 var name = GetCookie(id);//取Cook...
分类:其他好文   时间:2015-12-12 01:31:33    阅读次数:337
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!