SOURCE

function countNum(str1, str2) {
  return str2.split(str1).length - 1
}
console.log(countNum("a", "adfeadea")); //3
console 命令行工具 X clear

                    
>
console