title: How to create a set in Ballerina?
body: <p>I have a requirement to create a <code>set</code> of strings using an <code>array</code> of strings in Ballerina. Other than using <code>reduce()</code> or checking <code>indexOf()</code> before inserting, I couldn't find a way to create a <code>set</code> using Ballerina programming language.</p>
  <pre><code>    string[] arr = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;a&quot;, &quot;d&quot;, &quot;c&quot;];
      string[] set = arr.reduce(function(string[] accum, string item) returns string[] {
              if accum.indexOf(item) == () {
                  accum.push(item);
              }
              return accum;
          }, []);
  </code></pre>
  <p>Is there a better way to create a set in Ballerina?</p>