In C# syntax, you can use the Contains method to determine whether a collection contains an element, but how to deal with similar problems in JavaScript? There is no Contains method in js.
We can use the prototype extension of js to encapsulate our own Contains method.
js code: