Molecule.modifyBond

Arguments

let molecule = new Molecule();

molecule.bond(atomOne /* type: Atom */, atomTwo /* type: Atom */, changes /* type: Object */);

Returns

Type: Molecule

The function returns the parent molecule, and is thus chainable (e.g. Molecule.modifyBond(a, b, opt).modifyBond(b, c, opt)).

Interactive Example

const { Molecule } = require('mcul'); let molecule = new Molecule(); let atoms = molecule.createAtoms('C', 2); molecule.bond(atoms[0], atoms[1], {count: 2}); molecule.modifyBond(atoms[0], atoms[1], {count: 3}); console.log(molecule.getBond(atoms[0], atoms[1]));