Skip to main content

All Questions

3 votes
4 answers
638 views

Custom shapes objects using polymorphism in JavaScript

I have made the following example and want to know if it properly represents polymorphism in JavaScript. ...
Deadpool's user avatar
  • 139
10 votes
2 answers
273 views

There Was an Old Lady - generate lyrics to a cumulation song

This is a problem from exercism.io. View the repo here (contains full example of song). Problem statement: Generate the lyrics of the song 'I Know an Old Lady Who Swallowed a Fly'. While you could ...
jsuth's user avatar
  • 857
5 votes
2 answers
653 views

99 Bottles of Beer using polymorphism

This was part of an exercise from exercism.io. If you fancy, view the repo here. Given problem statement: Write a program which produces the lyrics to that beloved classic, that field-trip favorite:...
jsuth's user avatar
  • 857
6 votes
2 answers
232 views

Return the correct object type in Javascript

I am currently wondering if the following piece of Javascript code could be simplified? I would like to return the correct {},[],"" without having to pass a type as ...
MichelH's user avatar
  • 171
4 votes
1 answer
686 views

Check if JavaScript input is empty

Having a general utility function to see if the input is empty makes sense to me. Empty means different things depends on the type. I just spent ~5 minutes writing this one up, so I'm sure it's ...
A T's user avatar
  • 535