Skip to content

Commit

Permalink
- Easy peasy
Browse files Browse the repository at this point in the history
  • Loading branch information
PG-Momik committed Sep 29, 2024
1 parent 91886ab commit 5cf414a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _010_lengthOfLastWord.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @param {string} s
* @return {number}
*/
var lengthOfLastWord = function(s) {
const words = s.trim().split(' ');

return (words[words.length-1]).length
};

0 comments on commit 5cf414a

Please sign in to comment.