I am trying to assign to a variable the value of performance.memory.jsHeapSizeLimit But since it is not supported on Safari, I would like to assign to the same variable the value 0 when performance.memory.jsHeapSizeLimit doesn't work.
I am doing this:
(function () {
if (performance.memory.jsHeapSizeLimit !== undefined) {
var MAXmemoryAvailable = performance.memory.jsHeapSizeLimit;
} else {
var MAXmemoryAvailable = 0; }
})();
The problem is that on Safari it doesn't work and I have the error: undefined is not an object (evaluating 'performance.memory.jsHeapSizeLimit')
Any solution?