How to get count of character in string in JavaScript

Strings
Last updated Feb 16, 2018
const name = "Jad Joubran";

const countJ = name.split("J").length - 1;
2