-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtry.js
76 lines (68 loc) · 1.84 KB
/
try.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// var url = require("url");
// var adr = "http://localhost:8080/default.htm/negasi?year=2017&month=february";
// //Parse the address:
// var q = url.parse(adr, true);
const { fstat } = require("fs");
// /*The parse method returns an object containing url properties*/
// q.port = "8080";
// console.log(q);
// console.log(q.port);
// console.log(q.query);
// // console.log(q.pathname);
// // console.log(q.search);
// /*The query property returns an object with all the querystring parameters as properties:*/
// var qdata = q.query;
// // console.log(qdata.month);
// var router = {
// hyab: "Negasi",
// alu: "Fili",
// fiyori: "Dani",
// };
// var wife = "alu";
// console.log(router.wife);
// Node.js program to demonstrate the
// fs.truncate() method
// // Include the fs module
var fs = require("fs");
var path = require("path");
// // Completely delete the content
// // of the targeted file
// var filePath = path.join(__dirname, "./teacherdocx.docx");
// console.log(filePath);
// fs.truncate(filePath, function (err) {
// if (err) {
// console.log(`Error while truncating file: ${err}`);
// } else {
// console.log("File Content Deleted");
// }
// });
// Read directory
// fs.readdir(
// path.join(__dirname, "/.data/token/"),
// { withFileTypes: true },
// (err, files) => {
// if (err) {
// console.log(err);
// } else {
// files.forEach((file) => console.log(file.name.replace(".json", "")));
// }
// }
// );
// var temp = {
// name: "Negasi",
// age: 26,
// address: "Gerji",
// };
// temp.hyab = temp;
// console.log(JSON.stringify(temp));
// var a = { y: 10 };
// a.x = a;
// console.log(JSON.stringify(a));
// var arr = [1, "tur", { x: 2 }, [3, 4]];
// delete arr[1];
// console.log(arr);
let pers = ["name", "Ahmed"];
const memeber = pers;
pers = null;
console.log(memeber);
console.log(pers);