let molecule = new Molecule();
molecule.bond(atomOne /* type: Atom */, atomTwo /* type: Atom */, options /* type: Object */);
atomOne
- The first atom involved in the bondatomTwo
- The second atom involved in the bondoptions
- Options for the bond (see all here)Type: Molecule
The function returns the parent molecule, and is thus chainable (e.g. Molecule.bond(a, b).bond(b, c)
).
const { Molecule } = require('mcul'); let molecule = new Molecule(); let atoms = molecule.createAtoms('C', 2); molecule.bond(atoms[0], atoms[1], {count: 2}); console.log(molecule.getBond(atoms[0], atoms[1]));