Javascript Implementation of String