Skip to content

Commit 4fb372d

Browse files
committed
delet all comment lines
1 parent c8fd52b commit 4fb372d

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
1-
// The diagram below shows the different names for parts of a file path on a Unix operating system
2-
3-
// ┌─────────────────────┬────────────┐
4-
// │ dir │ base │
5-
// ├──────┬ ├──────┬─────┤
6-
// │ root │ │ name │ ext │
7-
// " / home/user/dir / file .txt "
8-
// └──────┴──────────────┴──────┴─────┘
9-
10-
// (All spaces in the "" line should be ignored. They are purely for formatting.)
11-
121
const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt";
132
const lastSlashIndex = filePath.lastIndexOf("/");
143
const base = filePath.slice(lastSlashIndex + 1);
154
console.log(`The base part of ${filePath} is ${base}`);
165

17-
18-
196
const startDirIndex = filePath.lastIndexOf("Users");
20-
const dir = filePath.slice(startDirIndex , lastSlashIndex);
7+
const dir = filePath.slice(startDirIndex, lastSlashIndex);
218
console.log(`The dir part of ${filePath} is ${dir}`);
229
const dotIndex = filePath.lastIndexOf(".");
2310
const ext = filePath.slice(dotIndex);
2411
console.log(`The ext part of the ${filePath} is ${ext}`);
25-

0 commit comments

Comments
 (0)