tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

string-substring-is-charat.js (237B)


      1 // |str.substring(0, 1)| is compiled as |str.charAt(0)|.
      2 
      3 const strings = [
      4  "",
      5  "a", "b",
      6  "ab", "ba",
      7 ];
      8 
      9 for (let i = 0; i < 1000; ++i) {
     10  let str = strings[i % strings.length];
     11 
     12  assertEq(str.substring(0, 1), str.charAt(0));
     13 }