DEV Community

Discussion on: Daily Challenge #1 - String Peeler

Collapse
 
jenc profile image
Jen Chan • Edited

Handwrote my answer to practice:

const firstLast = (str) => {
const letters = [...str];

if (letters.length <=2){
return null;
}

let trimmed = letters.shift().pop();
return trimmed.join('');
}
Now to see if it works...