#content
| let | 再代入可能 |
| const | 再代入不可能 |
| const [a, b, c, d] = ['a', 2, {c: '300'}, '四']; | 一度に変数宣言と代入 |
| console.log(`わたしは${a}`); | 文字列展開 |
const fn = (a, b) => a + b;
const fn = (a, b) => {
return a + b;
};
const fn = funciont(a, b) { return a + b; }
const array = [1, 10, 3]; console.log(...array);
const func2 = (...r) => console.log(...r);
const full = ({first,last}) => { return first + last; };
full({ first:'苗字',last:'名前'});
https://app.codegrid.net/entry/breakpoint-1
// この一文でprototypeプロパティが使えるようになる
function Foo() {};
// ここで定義を代入。
Foo.prototype = {
init:function() { alert('A');},
test:function() { alert('B');}
};
// newして使う必要があるのか・・・ var foo = new Foo(); foo.init();
function Foo() {};
Foo.prototype = {
init:function() { alert('A');},
test:function() { alert('B');}
};
Foo.A = function()
{
alert('A is static');
}
Foo.B = function()
{
alert('B is static');
}
// newして使う必要があるのか・・・
var foo = new Foo();
foo.init();
// prototypeをはさまないとそのまま実行可能!
Foo.A();
Foo.B();
一昔前の主流
2009年現在はこちらのほうがよろしいらしい。
http://www.slideshare.net/hayatomizuno/jquery-7665168
http://web-terminal.blogspot.jp/2012/11/jquery4.html
$(function () { alert('test'); });
setInterval(function(){ alert('test'); },10000);
if ($('#探したい場所のID .その配下のクラス').length > 0) { alert('test'); }
alert(typeof($.cookies.set));
定義されていればobjectとでる。
$('li')
$('li.hoge')
$('li#hoge')
$('DIV#contents LI')
$('DIV#contents > LI')
$('#first, #third")
$("a[href]").each(function(){
}
$("DIV#hoge a[href]").each(function(){
}
$("input[type='checkbox']").removeAttr( 'checked' );
$("input[type='checkbox']").attr( 'checked', 'checked' );
$(".hoge .fuga input[type='checkbox']").removeAttr( 'checked' );$("[href]")
$("[href='hoge']")
$("[href^='hoge']")
$("[href$='hoge']")
$("input").val();
$("input").val("初期値");$("input").("focus",function(){});
$("input").("blur",function(){});
$("input").("change",function(){});
input[type='text'] input[type='password'] input[type='radio'] input[type='checkbox'] input[type='submit'] input[type='image']
:selected :checked
JavaでかかれたJavaScript実装。J2SE6.0から標準添付