Get First Index Of Array Javascript Append Function In Prolog