8.Victory! The " " ant toLowerCase problems


#1

I can't say that I've real problems cause everything works, but...

1) I can't find another way of formating the output adress but using " ". It returns what I need but looks ugly. Maybe there are some other ways to format it?

console.log ("Address: " + friends[key].address[0] + '\n' + " " + friends[key].address[1] + add);

2) There's one more question. I wish to avoid input mistakes in search by using toLowerCase(). It'll help me but make all outputs in lowerCase, what isn't what i wish. Creating LowerCase copies of objects is too cumbersome. Are there some more elegant ways?


#2

your first question you can try this

console.log("Address: %s \n%s",friends[key].address[0] ,friends[key].address[1] + add);

to your second question there is no need to create copies in lower case but it also depends on the situation can you ellaborate on that with some code samples


#3

Thanks, I'll note your '%s \n%s' version. It's close but not exactly what I wish.
Unfortinately, the task was to get this:

Maybe it's possible to output the second adress element (Cupertino) under the first one without adding spaces in the code? (To make it perfect I had to make an extra function counting letters in the 'Adress' word. So I can't call that an elegant solution).

I've already fixed the case problem :sweat_smile: