hitung huruf

Run Settings
LanguageJavaScript
Language Version
Run Command
/* buat function dengan dua parameter a dan b. hitung berapa karakter a yg ada dalam kalimat b */ // youtube function str(a, b) { return b.split(a).length -1; } console.log(str('a', 'how many times the character occur on this sentence?')); console.log(str('e', 'how many times the character occur on this sentence?')); console.log(str('o', 'how many times the character occur on this sentence?')); console.log(str('t', 'how many times the character occur on this sentence?')); console.log(str('a', 'how many times the character occur on this sentence?')); console.log(str('a', 'how many times the character occur on this sentence?')); console.log(str('a', 'how many times the character occur on this sentence?'));
Editor Settings
Theme
Key bindings
Full width
Lines