Set.prototype.has(value)
This
method returns true, if the set has given element, else false.
var countries = new Set(); countries.add("India"); countries.add("Australia"); countries.add("Canada"); countries.add("Germany"); console.log("Is countries has India ? " + countries.has("India")); console.log("Is countries has France ? " + countries.has("France"));
Output
Is
countries has India ? true
Is
countries has France ? false
No comments:
Post a Comment