append DOM element in a functional way.
npm install fd-append --save
let append = require('fd-append')
, elem = require('fd-elem')
, appendtoBody = append(document.body);
let p = elem('p', 'Meow');
appendtoBody(p);
assert.equal(document.body.lastChild.innerText, 'Meow'); // true.
append :: parent -> child
A curried function that takes in:
-
parent -> DOM element to which the child must be appended.
-
child -> DOM element that needs to be appended.