Dell Technologies Interview Question

JavaScript code for lang. conversion?