Check if a function is declared before using it in js

Issue: it may occurs that you have to call a function that is conditionally set. A frequent use case would be GDPR where you set your tracking script conditionally. You micht check the cookie for each event you track, but I think a better solution would be to track if he function is declared.


There are two different options:

Option 1:

This option will still return an error in case the function to evaluate is not defined.

function isFunction(TrackingScript) {
   TrackingScript ('button-click','cart',10);

Option 2:

if (typeof( TrackingScript ) === typeof(Function)){
       TrackingScript ('button-click','cart',10); 

Resizing social media picture : Form factor

Just a quick bookmark here: we probably all look here and there for the correct form factor for our facebook cover picture or profile pic, and then again for every over social media platform. Well, of course, someone has develop a tool to help us with that so here you go:

I have not checked that the form factor currently used on the site are up to date with the latest standard for each platform.