code: public void sort(String func) {
          if (func == null || func.isEmpty()) {
              Object ary = invokeJavascript("sort");
          } else {
              Object ary = invokeJavascript("sort", func);
          }
      }
docs: sort() 	Sorts the elements of an array