จงเขียนฟังก์ชั่นที่รับ string ที่เป็นประโยคเข้าไป แล้วส่งค่าจำนวนคำที่นับได้ออกมา
Examples
countWords(” just an example here move along”) ➞ 6
countwords(“this is a test”) ➞ 4
จงเขียนฟังก์ชั่นที่รับ string ที่เป็นประโยคเข้าไป แล้วส่งค่าจำนวนคำที่นับได้ออกมา
Examples
countWords(” just an example here move along”) ➞ 6
countwords(“this is a test”) ➞ 4