Jump to navigation

Namespace: json

Numbas.json

Methods

(static) tryGet(source, attr) → {*}

Try to load an attribute with the given name from source. The given name and its lower-case equivalent are tried.

Parameters:
Name Type Description
source Object
attr String
Returns:
Type Description
*
Source:

(static) tryLoad(source, attrs, target, altnames)

Try to load an attribute with name from attr from source into target. Tries lower-case

Parameters:
Name Type Description
source Object

object to load value(s) from

attrs String | Array.<String>

the name, or list of names, of attributes to load

target Object

object to set values in

altnames String | Array.<String>

the name, or list of names, to set in the target object

Source: