Find Missing Element In Array Javascript Append Function In Prolog