let molecule = new Molecule();
molecule.getAtomsByElement(elementSymbol /* type: String */);
elementSymbol
- The symbol for the corresponding elementType: Array
[Atom
Instance]
The function returns an array of atom instances of the selected element.
const { Molecule } = require('mcul'); let molecule = new Molecule(); molecule.createAtoms('H', 4); let hydrogens = molecule.getAtomsByElement('H'); console.log(hydrogens);