Returns an object describing a physical constant which name matches the search string.
constant(searchString)
searchString
A constant name (full or partial) to search for.
If the search string matches a constant name exactly or there is only one result matching the string, the object describing the constant is returned.
The object contains the following properties:
name - the name of the constant
value - the value of the constant
unit - the string describing the unit of the constant
uncertainty - the uncertainty of the constant
If the search string matches multiple constant names or there were no constants found, throws an error.
Physics.constant("proton mass")
{
name: "proton mass",
value: 1.67262192369e-27,
unit: "kg",
uncertainty: 5.1e-37
}
Physics.constant("compton wavelength").value
2.42631023867e-12
Physics.constant("mass")
Error: multiple candidates found for "mass": ...
Physics.constant("ufo")
Error: no constants found for "ufo"