Copy more

I just wanted to replace the following Javascript code:

{languages: lang ? ['en', lang] : ['en'],};

with my preferred value, i.e. ‘el’ but I missed the obvious replacement which was

{languages: ['en','el'],}

and I was trying:

{languages: 'el'} //didn't work

So I copied the original (first) code above, and it worked providing even more functionality.

For a moment I thought that the problem was the trailing comma, I read more about it here, but it wasn’t.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s