Basic logic? I'm messing this up

Basic logic? I'm messing this up
0

#1

Somehow, I’m messing this up and overthinking it…

Something is not working in just the code below. We would expect ‘nadroJ laH’ but instead have ‘nadroj lah’. Which line do you believe is not correct?

Note: Assume that all the functions work as described:

var fullName = joinName(‘hal’, ‘jordan’)
var capitalizedName = capitalize(fullName)
var reversedName = reverseIt(fullName)

print(reversedName) // ‘nadroj lah’

EDIT: Is it var reversedName?


#2

Can you paste your full code?

I can’t see what your functions do.


#3

There isn’t code to it. You are supposed to assume that all functions work as described.


#4

well it should be the 2nd line then because the returned words are not capitalized.


#5

That’s what I thought and it wasn’t right…


#6

This line is the problem. It should be:

var reversedName = reverseIt(capitalizedName)

Why? Because, you want to reverse the capitalized version of fullName and not fullName which is still lower case.


#7

Oh, well geez. This is just ridiculous hahahaha