递归:
//1 1 2 3 5 8 13 21 34 ?
//1 2 3 4 5 6 7 8 9 ?
function dg(n) {
if(n == 1 || n == 2) {
return 1;
} else {
return dg(n - 1) + dg(n - 2);
}
}
alert(dg(9));
arr = [
[1,2],
[3,4]
];
arr[1][0];
正则表达式:
<script>
a = prompt();
var re = new RegExp(/^w+[@]w+[.][w.]+$/);
var x = a.match(re);
if(x != null){
alert("验证成功");
}
</script>