node.js打印function
var Person = function(name) {
this.name = name;
this.gender = ['man', 'woman'];
}
console.log(Person);
console.dir(Person);
console.dir(JSON.stringify(Person));
console.log(typeof(Person));
console.log(Person.toString());
上面打印的结果:
[Function: Person]
[Function: Person]
undefined
function
function (name) {
this.name = name;
this.gender = ['man', 'woman'];
}
可以采用toString()的方式对函数进行打印。
node.js打印function的更多相关文章
- 使用 Node.js 做 Function Test
Info 上周 meeting 上同事说他们现在在用 java 写 function test,产生了很多冗余的代码,整个项目也变得比较臃肿.现在迫切需要个简单的模板项目能快速搭建function t ...
- Node.js学习 - Function
Node.js函数和JavaScript类似 function say(word) { console.log(word); } function execute(someFunction, valu ...
- Node.js 指南(迁移到安全的Buffer构造函数)
迁移到安全的Buffer构造函数 移植到Buffer.from()/Buffer.alloc() API. 概述 本指南介绍了如何迁移到安全的Buffer构造函数方法,迁移修复了以下弃用警告: 由于安 ...
- 《Node.js核心技术教程》学习笔记
<Node.js核心技术教程>TOC \o "1-3" \h \z \u 1.章模块化编程 2019.2.19 13:30' PAGEREF _101 \h 1 08D ...
- Node.js学习 - CallBack Function
Node.js异步编程的直接体现就是回调,Node使用了大量的回调函数,其所有的API都支持回调. 阻塞代码实例(同步) var fs = require("fs"); var d ...
- [Node.js] 05 - Modules and Function
一个 Node.js 文件就是一个模块,这个文件可能是JavaScript 代码.JSON 或者编译过的C/C++ 扩展. 模块是Node.js 应用程序的基本组成部分,文件和模块是一一对应的. No ...
- Serverless Web Function 实践教程(一):快速部署 Node.js Web 服务
作为目前广受欢迎的 Web 服务开发语言,Node.js 提供了众多支持 HTTP 场景的相关功能,可以说是为 Web 构建而生.因此,基于 Node.js,也诞生了多种 Web 服务框架,它们对 N ...
- Node.js:进程、子进程与cluster多核处理模块
1.process对象 process对象就是处理与进程相关信息的全局对象,不需要require引用,且是EventEmitter的实例. 获取进程信息 process对象提供了很多的API来获取当前 ...
- Node.js npm 详解
一.npm简介 安装npm请阅读我之前的文章Hello Node中npm安装那一部分,不过只介绍了linux平台,如果是其它平台,有前辈写了更加详细的介绍. npm的全称:Node Package M ...
随机推荐
- websocket随笔
https://github.com/littlechaser/push-service 我们在浏览器调服务器的时候使用http连接通常就能实现,但是如果要服务器数据发生变化,需要主动推送给客户端(如 ...
- Using Dispatcher
he following code example shows how you might attempt to update the UI from your task logic. // The ...
- 爬虫案例(js动态生成数据)
需求:爬取https://www.xuexi.cn/f997e76a890b0e5a053c57b19f468436/018d244441062d8916dd472a4c6a0a0b.html页面中的 ...
- 深入理解Java中的同步静态方法和synchronized(class)代码块的类锁
一.回顾学习内容 在前面几篇博客中我我们已经理解了synchronized对象锁.对象锁的重入.synchronized方法块.synchronized非本对象的代码块, 链接:https://www ...
- supervisord.conf
; Sample supervisor config file.;; For more information on the config file, please see:; http://supe ...
- A Statistical Model for Scientific Readability-paper
Authors: Luo SiCarnegie Mellon University, Pittsburgh, PA Jamie CallanCarnegie Mellon University, Pi ...
- cmd运行jar
https://blog.csdn.net/lemon_tree12138/article/details/44081909 https://www.cnblogs.com/LanTianYou/p/ ...
- 分布式高并发下Actor模型
分布式高并发下Actor模型 写在开始 一般来说有两种策略用来在并发线程中进行通信:共享数据和消息传递.使用共享数据方式的并发编程面临的最大的一个问题就是数据条件竞争.处理各种锁的问题是让人十分头痛的 ...
- maven编译错误maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project
maven对项目编译时报错 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta ...
- day 102 GIT 的使用方法.
https://www.cnblogs.com/wupeiqi/articles/7295372.html 文件名为红色表示 此文件在工作区被修改的状态 ,需要通过git add .进行提交,提交到版 ...