From c226f73c83e20d2b1c7b1dbb2c2ce980513a766e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E7=B4=AB=E5=A6=8D?= <3053633754@qq.com> Date: Mon, 13 Feb 2023 10:43:43 +0800 Subject: [PATCH 1/3] 'homework' --- "node\344\275\234\344\270\232/work1.js" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "node\344\275\234\344\270\232/work1.js" diff --git "a/node\344\275\234\344\270\232/work1.js" "b/node\344\275\234\344\270\232/work1.js" new file mode 100644 index 0000000..154ae29 --- /dev/null +++ "b/node\344\275\234\344\270\232/work1.js" @@ -0,0 +1 @@ +console.log('今天星期一'); \ No newline at end of file -- Gitee From 81ba7f08a7dd35fbd7844ea183dfbb256839634e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E7=B4=AB=E5=A6=8D?= <3053633754@qq.com> Date: Tue, 14 Feb 2023 17:35:34 +0800 Subject: [PATCH 2/3] 'homework' --- .../action.js" | 21 +++++++++++++++++++ .../cc.js" | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 "\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/action.js" create mode 100644 "\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/cc.js" diff --git "a/\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/action.js" "b/\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/action.js" new file mode 100644 index 0000000..f12a798 --- /dev/null +++ "b/\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/action.js" @@ -0,0 +1,21 @@ +let action = { + 'jia':function(a,b){ + console.log(a+b); + }, + 'jian':function(a,b){ + console.log(a-b); + }, + 'cheng':function(a,b){ + console.log(a*b); + }, + 'chu':function(a,b){ + console.log(a/b); + }, + 'all':function(a,b){ + this.jia(a,b); + this.jian(a,b); + this.cheng(a,b); + this.chu(a,b); + } +} +module.exports=action; diff --git "a/\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/cc.js" "b/\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/cc.js" new file mode 100644 index 0000000..bd03c25 --- /dev/null +++ "b/\344\270\201\347\264\253\345\246\215/\345\212\240\345\207\217\344\271\230\351\231\244/cc.js" @@ -0,0 +1,2 @@ +let action=require('./action.js'); +action.all(6,5); \ No newline at end of file -- Gitee From df47d970a80f7800e5b102abda2e112e9d912aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E7=B4=AB=E5=A6=8D?= <3053633754@qq.com> Date: Thu, 16 Feb 2023 16:41:13 +0800 Subject: [PATCH 3/3] 'homework' --- .../node\344\275\234\344\270\232/work1.js" | 0 .../createfile.js" | 16 ++++++++++++++++ .../max.js" | 14 ++++++++++++++ 3 files changed, 30 insertions(+) rename "node\344\275\234\344\270\232/work1.js" => "\344\270\201\347\264\253\345\246\215/node\344\275\234\344\270\232/work1.js" (100%) create mode 100644 "\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/createfile.js" create mode 100644 "\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/max.js" diff --git "a/node\344\275\234\344\270\232/work1.js" "b/\344\270\201\347\264\253\345\246\215/node\344\275\234\344\270\232/work1.js" similarity index 100% rename from "node\344\275\234\344\270\232/work1.js" rename to "\344\270\201\347\264\253\345\246\215/node\344\275\234\344\270\232/work1.js" diff --git "a/\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/createfile.js" "b/\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/createfile.js" new file mode 100644 index 0000000..a65b85a --- /dev/null +++ "b/\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/createfile.js" @@ -0,0 +1,16 @@ + +var fs=require('fs'); +var arr = new Array(); +for(var i = 1;i<= 100;i++){ + arr[i-1] = Math.ceil(Math.random()*1001); + fs.writeFile( + i+'.txt', + ''+arr[i-1], + (err)=>{ + if(err){ + console.log(err); + } + } + + ) +} \ No newline at end of file diff --git "a/\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/max.js" "b/\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/max.js" new file mode 100644 index 0000000..675ee95 --- /dev/null +++ "b/\344\270\201\347\264\253\345\246\215/\351\232\217\346\234\272\347\224\237\346\210\220\346\226\207\344\273\266/max.js" @@ -0,0 +1,14 @@ +var fs=require('fs'); +var arr =new Array(); +for(var i=1;i<=100;i++){ + var data=fs.readFileSync(i+'.txt'); + arr[i-1]=data.toString(); + console.log("同步读取:"+i+"个"+arr[i-1]); + +} +var max=0; +for(var j=0;j