Vernost Interview Question

Write a program in javascript to find duplicate in a string