DEV Community

Cover image for Ghostbusters Challenge/JavaScript Challenge
ryanAllMad
ryanAllMad

Posted on

2

Ghostbusters Challenge/JavaScript Challenge

Okay,

I thought of this stupid little snippet of JS that has been cracking me up all day. I wanted to create a snippet of JS code that would emulate the line from the Ghostbusters theme song: "If there's something strange in your neighborhood, who you gonna call? Ghostbusters"

So this is what I came up with:

{
let somethingStrange = 1;
let neighborhood = 1;

function whoYouGonnaCall() {
if (somethingStrange === neighborhood) {
whoYouGonnaCall = 'Gohstbusters';
console.log(whoYouGonnaCall);
} else {
console.log('I ain\'t afraid of no ghost');
}
}
whoYouGonnaCall();

}

This prints Ghostbusters to the console.

I thought this would be a great learning exercise for me and others to learn something from other JS devs. I know there are more experienced JS devs out there who can put together a more creative JS snippet that expresses this same line in a different way, and I would love if you would take a crack at it.

Challenge:
Please show us how you would use JS to express:
"If there's something strange in your neighborhood, who you gonna call? Gostbusters"

Rules are:
1.) it has to work.
2.) it would be great if you explained why you chose the snippet you chose
3.) Please share an explanation of it's result.

Thanks!!

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay