npm.io
0.1.0 • Published 8 years ago

platzom-v2

Licence
MIT
Version
0.1.0
Deps
0
Vulns
0
Weekly
0

Platzom

Platzom es un idioma inventaso para el curso de javascript en platzi

Descripcion del idioma

note: When we execute methods over str they are not modifies so that is why we create the variable translation above

  • SCRIPT FLOW

First if statement: if the word ends with "ar", cut out the last two characters

Second if statement: if the word begins with "z", we add "pe" at the end

Second if statement: if the word begins with "z", we add "pe" at the end

Third if statement: if the word translated has 10 letters or more, separate it in the middle by a "-"

Fourth if statement: if the original string is a palindrome, then none of the other rules apply and we return the same word but width everyother letter being capitalized

Instalacion

npm install platzom

import platzom from `platzom`

console.log(platzom("programar")); // program
console.log(platzom("Zorro")); // zorrope
console.log(platzom("Zarpar")); // zerppe
console.log(platzom("abecedario")); // zerppe
console.log(platzom("sometemos")); // SoMeTeMoS

Creditos

Daniel Arenas

license

MIT

Keywords