Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
function textTransformator(text) {
// your code here
var split = text.split('')

var hasil = []
for (i = 0 ; i < split.length ; i++){

if (split[i] === 'e'){
hasil.push('3')
} else if ( split[i] === 'i'){
hasil.push('1')
} else if ( split[i] === 'a'){
hasil.push('4')
} else if ( split[i] === 'o'){
hasil.push('0')
} else {
hasil.push (split[i])
}
}
return hasil.join('')

}

// TEST CASE:
Expand Down