I have been utilizing exif.js to extract metadata from the images I upload on a content management system (CMS). However, sometimes when an image does not contain any metadata, certain values may show up as "undefined". My goal is to replace these "undefined" values with empty strings. Stanley's approach seems like a viable solution:
var i;
var j = (typeof(i) !== 'undefined' ? i : '');
console.log(j); // ''
Despite spending hours analyzing the code, I am unable to pinpoint how exif.js generates the undefined value that I need to change to an empty string.
You can access the exif.js library here: https://github.com/exif-js/exif-js/blob/master/exif.js