Bash String Functions Substring Javascript Method Overloading