var positions = {
arrivals: 0,
immigration: 0,
testing: 0,
baggage: 0,
exiting: 5,
undefined: 0,
};
var objects = {
immigration: [],
immigrationQueue: [],
passengers: [],
testing: [],
testingBox: [],
testingQueue: [],
baggage: [],
baggageQueue: [],
};
// Get the key of a certain value by going through
// the whole object.
function getKeyByValue(object, value) {
return Object.keys(object).find((key) => object[key] === value);
}
// How to access values through keys
objects.immigration == []; // true
let newString = immigration;
objects[newString] == []; // true
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter