Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
配列に数値を追加しようとしています。
コード:
var year = mm[2].value+1;
しかし、結果は未定義です。
これを行う方法はありますか?
追加する前に、文字列を整数に解析する必要があります。
var dt = "12/02/2012"; var mm = de.split("/"); var year = parseInt(mm[2])+1;