+ 2

Plz help me 😔😔

What i am doing wrong here!! function names(fName) { let a = fName + "is good boy"; return a ; } ; let returnVal = names(Ghulamyaseen) console.log(returnVal) //i want is that just i put fname value and it returns name with string "is good boy" why coming error, new to programming if there is other way in function plz tell me,..

8th Oct 2020, 5:36 PM
G. Yaseen
G. Yaseen - avatar
1 Antwort
+ 2
Argument of function has to be a string value in this case, now it looks like you want to use variable as an argument so it should be like this: let returnVal = names("Ghulamyaseen");
8th Oct 2020, 5:45 PM
ThreeG
ThreeG - avatar