Slashdot Mirror


Mozilla Extending Javascript?

Nomad128 writes "Mozilla's Deer Park 1 Alpha RC appears to have extended the Javascript spec for the first time in quite some time. New features include Array object methods "every" (logical AND), "some" (logical OR), "map" (function mapping), and "forEach" (iteration). They also appear to have added native XML support. Will this speed up the development of AJAX applications and give Moz a leg-up over IE7?"

3 of 286 comments (clear)

  1. A signature I have seen somewhere by Skiron · · Score: 0, Offtopic

    The march of progress:

    C:
    printf("%10.2f", x);

    C++:
    cout << setw(10) << setprecision(2) << showpoint << x;

    Java:
    java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
    formatter.setMinimumFractionDigits(2);
    formatter.setMaximumFractionDigits(2);
    String s = formatter.format(x);
    for (int i = s.length(); i < 10; i++)
    System.out.print(' ');
    System.out.print(s);

    1. Re:A signature I have seen somewhere by CableModemSniper · · Score: 0, Offtopic

      C++: #include printf("%10.2f", x); // or #include char s[14]; sprintf(s, "%10.2f", x); cout s; Java: String s = String.format("%10.2f", x); System.out.print(s);

      --
      Why not fork?
    2. Re:A signature I have seen somewhere by CableModemSniper · · Score: 0, Offtopic
      Oh god did that ever come out wrong.
      C++:
      #include <cstdio>
      printf("%10.2f", x);
      // or
      #include <cstring>
      char s[14];
      sprintf(s, "%10.2f", x);
      cout << s;
      Java:
      String s = String.format("%10.2f", x);
      System.out.print(s);
      --
      Why not fork?