Check if string ends with in JavaScript

name.endsWith('b')