回答編集履歴

2

a

2018/07/06 08:17

投稿

HayatoKamono
HayatoKamono

スコア2415

test CHANGED
@@ -82,7 +82,7 @@
82
82
 
83
83
  const slugify = compose(toLowerCase, joinWith('-'), splitBy(' '), trim)
84
84
 
85
- console.log(slugify(' my first blog entry ')); // "my-first-blog-entry"
85
+ console.log(slugify(' My First Blog Entry ')); // "my-first-blog-entry"
86
86
 
87
87
  ```
88
88
 

1

a

2018/07/06 08:17

投稿

HayatoKamono
HayatoKamono

スコア2415

test CHANGED
@@ -78,9 +78,11 @@
78
78
 
79
79
 
80
80
 
81
+ // 左右の空白除去してハイフン区切りのスラグを作成する関数をcompose
82
+
81
83
  const slugify = compose(toLowerCase, joinWith('-'), splitBy(' '), trim)
82
84
 
83
- console.log(slugify(' Hello World ')); // "hello-world"
85
+ console.log(slugify(' my first blog entry ')); // "my-first-blog-entry"
84
86
 
85
87
  ```
86
88