let molecule = new Molecule();
molecule.getAtomById(id /* type: String */);
id - An identifier string for an atomType: Atom Instance
The function returns an instance of the corresponding Atom.
const { Molecule } = require('mcul'); let molecule = new Molecule(); let hydrogen = molecule.createAtom('H'); let id = molecule.getAtomId(hydrogen); hydrogen = molecule.getAtomById(id); console.log(hydrogen);