let molecule = new Molecule();
molecule.hydrogenateCarbon(carbonAtom /* type: Atom */);
carbonAtom
- The carbon atom to hydrogenateType: Molecule
The function returns the parent Molecule
.
const { Molecule } = require('mcul'); let molecule = new Molecule(); let carbons = molecule.chainCarbons('C', 2); molecule.hydrogenateCarbon(carbons[0]); console.log(molecule.getBondCount(carbons[0]), molecule.getBondCount(carbons[1]));