Daniel Cobo
{🍦}

{🍦}

Follow
home

Bulletproof type checks in JavaScript

May 17, 20213 min read

Using typeof To check what type is a variable you would most likely use the typeof function. You can even skip the parenthesis (typeof someVariable is...

Bulletproof type checks in JavaScript

Get the first and last moment of a day in Javascript

May 10, 20212 min read

Here are 2 ready-to-use functions to get the first and last millisecond of a day using a few lines of vanilla JavaScript. Get the first moment of a...

Get the first and last moment of a day in Javascript

Check if the user is from EU with JavaScript

May 3, 20213 min read

Obviously your best guess is to ask the user. That being said, we generally want to avoid interrupting the user. Websites and apps are (or at least...

Check if the user is from EU with JavaScript

Get user's preferred languages with JavaScript

Apr 26, 20211 min read

Skip to solution If you have different language settings in your website or application wouldn't it be great if you could automatically set the...

Get user's preferred languages with JavaScript

Get location by IP with JavaScript

Apr 19, 20214 min read

Skip to solution. Problem Knowing your customer location can help you tailor their experience. Other times you may want to check for this information...

Get location by IP with JavaScript

Use custom CSS for image input

Apr 12, 20212 min read

Skip to solution. Problem HTML supports image input and on mobile it will even do all the heavy lifting for the Camera API for you, providing a nice...

Use custom CSS for image input