Nagarro interview question

Convert : person_First_Name to personFirstName

Interview Answers

Anonymous

14 Sept 2021

var name = "person_First_Name"; var d = name.split("_").join(""); console.log(d);

3

Anonymous

14 Sept 2021

'Person_First_Name'.split("_").join("");

2

Anonymous

12 May 2021

function convertor(name){ let result="" splittedNames=name.split("_") splittedNames.map(a=>{ result+=a }) console.log(result); } convertor("Person_First_Name")

2

Anonymous

7 May 2021

function parseName(input) { var fullName = input || ""; let result =''; if (fullName.length > 0) { let str = fullName.split("_"); str.forEach((word) => { result = result.concat(word) }) } return result; } parseName('person_First_Name')

1