2017 Dec 17 if (/\.(gif|jpg|jpeg|tiff|png)$/i.test(input)) { const itHappened = true; } else { const itHappened = false; }
…in reply to @404boyfriend 2017 Dec 17 Or, more succinctly: const itHappened = /\.(gif|jpg|jpeg|tiff|png)$/i.test(input) ? true : false;