0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FIFO(先入れ先出し法) javascript

Posted at

今度は、先入先出法のFIFO(first in first out)

今度は、
shift()=配列の最初を取り出す
メソッドが重要になってくる。

var ary=[];

ary.push('aa');
ary.push('bb');
ary.push('cc');
document.write('ary=' + ary + '<br>');  //ary=aa,bb,cc

var shift1=ary.shift();
document.write('shift1=' + shift1 + '<br>');   //shift1=aa
document.write('ary=' + ary + '<br>');  //ary=bb,cc

var shift2=ary.shift();
document.write('shift2=' + shift2 + '<br>');  //shift2=bb 
document.write('ary=' + ary + '<br>');   // ary=cc

プリンターの印刷街などに使用されているらしい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?