Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <script>
    var r = /f/g; // has to be a global matcher
    var f = "foo";
    
    //document.write because LULZ
    document.write(r.test(f) + "<br>");
    document.write(r.test(f) + "<br>");
    document.write(r.test(f) + "<br>");
    document.write(r.test(f) + "<br>");
    
    document.write("<br><br>");
    
    var g = "foof".substring(0,3); // make separate instance?
    document.write(r.test(f) + "<br>");
    document.write(r.test(g) + "<br>");
    
  </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers