MCPcopy Index your code
hub / github.com/processing/p5.js / getString

Method getString

src/io/p5.XML.js:900–908  ·  view source on GitHub ↗

* Return an attribute's value as a string. * * The first parameter, `name`, is a string with the name of the attribute * being checked. For example, calling `myXML.getString('color')` returns the * element's `id` attribute as a string. * * The second parameter, `defaultValue`, is o

(name, defaultValue)

Source from the content-addressed store, hash-verified

898 * }
899 */
900 getString(name, defaultValue) {
901 const obj = {};
902
903 for (const attribute of this.DOM.attributes) {
904 obj[attribute.nodeName] = attribute.nodeValue;
905 }
906
907 return obj[name] ? String(obj[name]) : defaultValue || null;
908 }
909
910 /**
911 * Sets an attribute to a given value.

Callers 8

logResultsFunction · 0.45
logResultsFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
loadTable.jsFile · 0.45
filesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected