EPAM Systems interview question

Javascript Problem solving in javascript