Grid objects and methods (JavaScript)