Skip to content

Commit 179cb40

Browse files
authored
Merge pull request #1890 from mlarghydracept/getNum()-vs-getNumber()-#1885
Get num() vs get number() #1885
2 parents 36428d8 + 7d0667f commit 179cb40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/io/p5.XML.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var p5 = require('../core/core');
3737
* var children = xml.getChildren("animal");
3838
*
3939
* for (var i = 0; i < children.length; i++) {
40-
* var id = children[i].getNumber("id");
40+
* var id = children[i].getNum("id");
4141
* var coloring = children[i].getString("species");
4242
* var name = children[i].getContent();
4343
* print(id + ", " + coloring + ", " + name);
@@ -565,7 +565,7 @@ p5.XML.prototype.hasAttribute = function(name) {
565565
* is returned. If no defaultValue is specified and the attribute doesn't
566566
* exist, the value 0 is returned.
567567
*
568-
* @method getNumber
568+
* @method getNum
569569
* @param {String} name the non-null full name of the attribute
570570
* @param {Number} [defaultValue] the default value of the attribute
571571
* @return {Number}
@@ -589,14 +589,14 @@ p5.XML.prototype.hasAttribute = function(name) {
589589
*
590590
* function setup() {
591591
* var firstChild = xml.getChild("animal");
592-
* print(firstChild.getNumber("id"));
592+
* print(firstChild.getNum("id"));
593593
* }
594594
*
595595
* // Sketch prints:
596596
* // 0
597597
* </code></div>
598598
*/
599-
p5.XML.prototype.getNumber = function(name, defaultValue) {
599+
p5.XML.prototype.getNum = function(name, defaultValue) {
600600
return Number(this.attributes[name]) || defaultValue || 0;
601601
};
602602

0 commit comments

Comments
 (0)