Molecule.createAtoms

Arguments

let molecule = new Molecule();

molecule.createAtoms(elementSymbol /* type: String */, count /* type: Number */);

Returns

Type: Array[Atom Instance]

The function returns an array of generated Atom instances linked to the molecule.

Interactive Example

const { Molecule } = require('mcul'); let molecule = new Molecule(); let hydrogen = molecule.createAtoms('H', 3); console.log(hydrogen);