Convert a String to a Number

Lee·2022년 6월 1일

Algorithm

목록 보기
2/92
post-thumbnail

❓ Sentence Smash

Q. Write a function that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any need to sanitize words or add punctuation, but you should add spaces between each word. Be careful, there shouldn't be a space at the beginning or the end of the sentence

✔ Solution

const stringToNumber = function(str){
  return parseInt(str);
}
  let str = "1234";

Check

profile
Lee

0개의 댓글