Ad
Code
Diff
  • function wordCount(str) { 
        return str.trim() == '' ? 0 : (str.trim().split(" ")).length;
    }
    • function wordCount(str) {
    • return (str.split(" ")).length;
    • return str.trim() == '' ? 0 : (str.trim().split(" ")).length;
    • }