您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Node.js 函数

2024/4/23 22:12:50发布23次查看
node.js 函数
匿名函数:scope.js
[code]function execute(somefn, value) { somefn(value); } execute(function (word) { console.log(word) }, 'hello');
函数传递是如何让http服务工作的
案例:server.js
[code]var http = require('http'); var onrequest = function (request, response) { response.writehead(200, { "content-type" : "text/plain"}); response.write("hello world"); response.end(); } http.createserver(onrequest).listen(8888); console.log('服务器监听端口 8888');
客户端:http://localhost:8888/%e5%87%bd%e6%95%b0/server.js
以上就是node.js 函数的内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product