Using Peek in Pas2JS

Top 

Example code : Using Peek in Pas2JS

var

  fruits : array of String = ["Banana", "Orange", "Apple", "Mango", "Banana", "Abacate", "Apple"];

begin

  WriteLn( fruits.Peek() );

Apple

---------

 

JS output:

      var fruits = [];

      var fruits = ["Banana","Orange","Apple","Mango","Banana","Abacate","Apple"].slice();

      WriteLn($Peek(fruits,""));