Yes, WordPress will issue a permanent redirect on any variations of site address, so not-www to www, no trailing slash to trailing slash, etc, all 301 redirects.
With that said though, a few tiny thoughts:
1. Neither Google nor any major search engine will see content between www and non-www of *the same domain name* as harmful duplicate content, they actually consider both to be the same site.
2. www is an old protocol from back when everything was under separate server hardware. www (www.example.com) was the web server, mail (mail.example.com) was the mail server, ftp (ftp.example.com) was the FTP server, print (print.example.com) was the print server, etc. These days, everything is run under the web server, making www. redundant and a waste of four characters. non-www is the way to go.