Skip to content

Commit

Permalink
Update prototipo.js
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioSmuu committed Jul 8, 2021
1 parent 0b08ac4 commit 4960524
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handler/core/prototipo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Array.prototype.unique = function(){
}

String.prototype.formal = function(){
var palavra = this.toLowerCase().split(' ')
let palavra = this.toLowerCase().split(' ')

palavra.map((letras, i) => {
let inicial = letras[0]
const inicial = letras[0]
letras = (letras.length > 3) ? inicial.toUpperCase()+letras.slice(1) : inicial+letras.slice(1)
palavra[i] = letras
palavra[0][0] = palavra[0][0].toUpperCase()
})

return palavra.filter(e => e != 'undefined').join(' ')
}
}

0 comments on commit 4960524

Please sign in to comment.