Better jQuery code for checking Duplicate in Array
<p>I have following code for checking whether there is duplicate in an array. The code works fine. But it uses a new array named newUniqueArray. Is there a better code for this purpose without using a new array? Is there any optimization possible on this code?</p>

<p>Note: I have used <code>inArray</code> and <code>in</code> keywords from jQuery</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.1.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        $('#btnSave').click(function (e) {
            var reportRecipients = "A, a , b,";
            reportRecipients = reportRecipients.toLowerCase();
            checkDuplicate(reportRecipients);
        });

        function checkDuplicate(reportRecipients) {
            if (reportRecipients.length &gt; 1) {
                var recipientsArray = reportRecipients.split(',');
                var newUniqueArray = [];

                for (a in recipientsArray) {
                    var email = $.trim(recipientsArray[a]);

                    if ($.inArray(email, newUniqueArray) == -1) {
                        newUniqueArray.push(email);
                    }
                }

                if (newUniqueArray.length &lt; recipientsArray.length) {
                    alert('Duplicate Exists');
                }

                return false;
            }
        }
    });
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input name="txtName" type="text" id="txtName" /&gt;
&lt;input type="submit" name="btnSave" value="Save" id="btnSave" /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
