Skip to content

Commit

Permalink
Update 2023-1-13-retos-programacion.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
TripleYei authored Oct 26, 2023
1 parent 4cd4b93 commit bdcc2ce
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions _posts/2023-1-13-retos-programacion.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -757,3 +757,31 @@ function convert(c) {
return (c * 9 / 5) + 32
}
~~~~

Convert to Binary

~~~~
function translate(n) {
return ( n >>> 0).toString(2)
}
~~~~

Swap Vowels

~~~~
function swapVowels(word) {
const letters = {
a:1,
e:2,
i:3,
o:4,
u:5
}
for(let i=0;i<word.length;i++)
if(letters[word[i]])
word = word.replace(word[i], letters[word[i]])
return word
}
~~~~~

0 comments on commit bdcc2ce

Please sign in to comment.