function
setup() {
createCanvas(550, 500);
textSize(16);
let tmpObj = {
"Statue of Unity"
:
"182 m"
,
"Spring Temple Buddha"
:
"128 m"
,
"Ushiku Daibutsu"
:
"100 m"
,
"Great Buddha of Thailand"
:
"92m"
};
let stringDict =
createStringDict(tmpObj);
text(
"New string dictionary created "
+
"with four keys"
, 20, 40);
let existOne =
stringDict.hasKey(
'Spring Temple Buddha'
);
text(
"Dictionary has key "
+
"'Spring Temple Buddha': "
+
existOne, 20, 80);
let currSize = stringDict.size();
text(
"Current size of the dictionary: "
+
currSize, 20, 100);
stringDict.clear();
text(
"Dictionary has been cleared!"
,
20, 140);
existOne =
stringDict.hasKey(
'Spring Temple Buddha'
);
text(
"Dictionary has key "
+
"'Spring Temple Buddha': "
+
existOne, 20, 180);
currSize = stringDict.size();
text(
"Current size of the dictionary: "
+
currSize, 20, 200);
}