Bash String Functions In Javascript Interview