// filter筛选数据再传返回
const arry=[{
id:1,
name:"小张"
},
{
id:2,
name:"梦泪"
}]
console.log(arry);...
阅读全文...
JavaScript 将一个数组的每一个对象指定关键词存入另一个数组arry.map(item=>item.关键字)
const arry=[{
id:1
},
{
id:2
}]
console.log(arry);
//原本数据[ { id: 1 }, { id: 2 } ]
const arry2=arry.map(item=>item...
阅读全文...
阅读全文...
nodejs get请求axios
const axios = require("axios")
//axios.get("网站")
axios.get("https://www.baidu.com/")
.then(functi...
阅读全文...
阅读全文...
Node.js-读取文件,追加数据
1:const fs = require('fs')2追加数据fs.appendFileSync('xxx.txt','追加的数据内容', function (err) { if (err) throw err;
console.log('视频+1')...
阅读全文...
阅读全文...
调用js文件里面的函数
1.文件1:test1.jsfunction name(){console.log("您好");}module.exports={name}2.文件2:test2.js//引入文件.const thisname=require("./...
阅读全文...
阅读全文...