Return First Element Of Array Javascript Append Function In Prolog