As I loop through my data, I only want to assign a random number to a fontObj
if it is unique.
A typical fontObj
consists of:
{
postscript: "Calibri",
style: "Bold",
family: "Calibri"
}
In my code, I aim to iterate through paragraphs and utilize the fontObj
as a key.
Here's some pseudocode to illustrate my approach:
if (fontMap[fontObj]) {
console.log("Already found: " + fontObj + " and the random number is " + fontMap[fontObj])
} else {
fontMap[fontObj] = Math.random()
}
I'm exploring the best way to structure this since I cannot directly check for the existence of an entire object using just a key. Any insights?