Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5467a59

Browse files
udating comment for function
1 parent f898fe3 commit 5467a59

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

‎sentence_to_hashing_converter.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
/*
2+
3+
This functions converts a hast to setence
4+
5+
Example :
6+
Input: "What are JWT"
7+
Output: "#what-are-jwt"
8+
9+
this can be used to link questions
10+
11+
*/
12+
113
function hashing(str) {
214
return (
3-
"#" +
15+
'#' +
416
str
5-
.trim("")
6-
.split(" ")
17+
.trim('')
18+
.split(' ')
719
.map((ele) => ele.toLowerCase())
8-
.join("-")
20+
.join('-')
921
);
1022
}
1123

12-
console.log(hashing("What are JWT"));
24+
console.log(hashing('What are JWT'));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /