feat(*): 代码仓库初始化
This commit is contained in:
14
Server/tests/test2/index.js
Normal file
14
Server/tests/test2/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const myModule = require("./myModule");
|
||||
|
||||
console.log("Auther: ", myModule.auther);
|
||||
console.log(myModule.greet("Alice"));
|
||||
console.log("Sum: ", myModule.add(3, 5));
|
||||
|
||||
const lodash = require("lodash");
|
||||
|
||||
const array = [1, 2, 3, 4, 5];
|
||||
const result = lodash.reverse(array);
|
||||
console.log("Reverse array: ", result);
|
||||
|
||||
const gt3 = array.filter((n) => lodash.gt(n, 3));
|
||||
console.log("Greater than 3: ", gt3);
|
||||
15
Server/tests/test2/myModule.js
Normal file
15
Server/tests/test2/myModule.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const auther = "harry";
|
||||
|
||||
const greet = (name) => {
|
||||
return `Hello, ${name}!`;
|
||||
};
|
||||
|
||||
const add = (a, b) => {
|
||||
return a + b;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
auther,
|
||||
greet,
|
||||
add
|
||||
}
|
||||
Reference in New Issue
Block a user