error in language reference

edited February 2016 in General

I think I have found an error in the language reference
https://processing.org/reference/IntDict_add_.html

IntDict inventory;   
 void setup() {
      size(200, 200);
      inventory = new IntDict();
      inventory.set("cd",84);
      inventory.set("tapes",15);
      inventory.set("records",102);
      println(inventory);  // There are 84 cds
      inventory.add("cds", 20);
      println(inventory);  // There are 104 cds
    }

the add method add an element in the dictionnarie whereas the example said it sum the value to the existing key ...

Tagged:

Answers

Sign In or Register to comment.