M

@miguladg

Practicar de Nuevo, CamelCase

NodeJS
2 years ago
const solution = string => { return [...string].map((char) => { return (char === char.toUpperCase()) ? ` ${char}` : char; }).join(''); } console.log("Hello world!");

Ejecicios de practica del Set y arrays

NodeJS
2 years ago
// const str = "helloo"; // const uniqueChars = new Set(str); // // esta funcio envia un array ejemplo Output Set(4) { 'h', 'e', 'l', 'o' } // console.log(uniqueChars) // //set pose muchas funcionalidades por ejemplo // // comprobar que todos los caracteres son unicos // function hasUniqueCharacters(str) { // return new Set(str).size === str.length;

other way

NodeJS
2 years ago
function validatePIN(pin) { if (pin.length == 4 || pin.length == 6) { if (isNaN(pin) == true) { return false } else if (pin < 0) { return false } else if (pin.startsWith('+', '-', ' ', '.')) { return false } else if (pin.includes('.', "'", "+", " ")) { return false }

function frstNonConsecutive

NodeJS
2 years ago
function seccitonBad (numbers){ // count numbers // console.log("hola", numbers) for(let i = 0; i < numbers.length; i++){ if(numbers[i] !== i + numbers[0]){ console.log(i, 'position', (i + numbers[0]), "numbers", numbers[i]) // return numbers[i] } } }

abbrevName

NodeJS
2 years ago
function abbrevName(name){ console.log(name.split(' ').map(x => x.substr(0, 1).toUpperCase()).join('.')); console.log("hola") return name.split(' ').map(x => x.substr(0, 1).toUpperCase()).join('.'); } abbrevName('Miguel angel');

arbolito alto

PHP
2 years ago
<?php function arbolito($pisos){ for ($i=0; $i<$pisos; $i++){ echo str_repeat("*", $i). "\n"; } } arbolito(10);