webproger > cheat sheets > JavaScript
 
 charAt, charCodeAt, fromCharCode
<!DOCTYPE html><html><head>
</head><body>
<script>
  var c = 3;
  var s = "대한민국";
  for(i=0; i<s.length; i++) {
    document.write(s.charCodeAt(i));
    document.write(' ');
    document.write(s.charAt(i));
    document.write('<br>');
  }
  var o = '';
   ...
http://qindex.info/i.php?f=22#742
 
 charCodeAt, fromCharCode
s = '대한민국\nKorea';
s = s.replace("\n","\\n");
for(i=0; i<s.length; i++) {
  n = s.charCodeAt(i);
  c = String.fromCharCode(n);
  document.write('<br>'+n+' '+c);
} ...
http://qindex.info/i.php?f=22#2634
 
 exec
<script>
  var s = "JavaScript MySQL";
  var r = /[0-9a-z]+/g;
  while(a=r.exec(s)) {
    document.write('<br>'+a);
  }
</script>

ava
cript
y ...
http://qindex.info/i.php?f=22#2630
 
 setTimeout
s = '';
i = 0;
function f1( ) { s += ' B'+i; }
function f2(j) { s += ' C'+j; }

window.setTimeout("s += ' A'+i;",1000);
window.setTimeout(f1( ),2000);
window.setTimeout(f2(i),3000);
i++;
// B0 C0 A1


function r() {
  window.setTimeout("s += ' A'+i;",1000 ...
http://qindex.info/i.php?f=22#253

-