在定义函数时,我们一般使用下面这两种方法: 使用函数声明定义: 1 2 3 function sum (a, b) { return a + b; } 使用函数表达式定义: 1 2 3 var sum = function (a, b) { return a + b; } 调用方法都是一样的: 如求“1+1”等于几: 1 alert(sum(1, 1)); 但这两种方法还是有区别的.解析器在向执行环境中加载数据时,对函数声明和函数表达式并非一视同仁.解析器会率先读取函数声明,并
MongoDB save()方法和insert()方法的区别 首先看官方文档怎么说的 Updates an existing document or inserts a new document, depending on its document parameter save方法有更新和插入两种功能,到底是插入还是更新文档取决于save的参数.那么到底是依赖于哪个参数呢?继续看 If the document does not contain an _id field, then the sa