UNPKG
snoopify
Version:
latest (1.0.1)
1.0.1
A node module that converts strings of words into Snoop Dog "izzle"-ified words
snoopify
/
index.js
13 lines
(10 loc)
•
276 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
function
snoopify
(
string
)
{
var
words =
string
.split(
' '
);
for
(
var
i =
0
; i < words.length; i++) {
if
(words[i].length >=
4
) { words[i] = words[i].slice(
0
, words[i].length -
3
).concat(
'izzle'
); } }
return
words.
join
(
' '
); } module.exports = snoopify;