File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments