How to get count of character in string in JavaScript

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

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