自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 2021-07-20

** while(),for()循环 switch()多选,函数封装传参,js基础ITM机 **let arr = [ { name: `zs`, pwd: 123, money: 1000 }, { name: `ls`, pwd: 234, money: 1500 }, { name: `ww`, pwd: 555, money: 2000 }]; //主函数 function main() { state = true while (state) {

2021-07-20 16:57:42 68

原创 # [解构如何运用的解构--报错 throw new TypeError(‘Router.use() requires a middleware function but got a ‘ + gett

let aa={ error_code: 0, reason: "插入数据成功" };//如何拿到 error_code 和 reason 的值let { error_code, reason } = aa; console.log(error_code,reason); // 输出0 和 插入数据成功 对于报错throw new Typ eError('Router.use() requires a middleware function but got a ’ + gettype(fn))

2020-09-24 18:08:47 199

原创 Commonjs模块的导入导出,module.exports 和 exports 的区别以及包管理器

Commonjs 里面模块的导入导出 在 Commonjs里面,通过module.exports来导出一个模块,通过require来导入一个模块。 示例如下: // index2.js module.exports.name = "xiejie"; module.exports.sayHello = function(){ console.log('Hello'); } const obj = require('./index2.js'); console.log(obj.name); // xi

2020-09-20 10:15:28 501

原创 使用 http 模块来实现简单的爬虫及资源压缩

所谓爬虫,就是用来爬取网页的内容。 在 nodejs 中,可以使用 http 和 https 模块来实现简单爬虫。会使用到一个模块,cheerio 模块。该模块可以将返回的字符串转为 jQuery 中的 $ 对象,从而可以使用 jQuery 中的各种方法。 const https = require('https'); const cheerio = require('cheerio'); // 爬虫的思路很简单,其实就是发送 http 请求,去请求那个页面 // 接下来拿到响应的内容,然后筛选有用的信.

2020-09-20 10:09:40 231

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除