I want to create a canvas element and get it’s context. I tried everything, but can’t get rid of the buffer variable. It’s driving me insane. Can you help me?
(function(buffer){
document.body.appendChild(
buffer=document.createElement("canvas")
)
canvas=buffer.getContext("2d")
})()
What’s wrong with the variable? Anyways, you can do:
since
Node.appendChildreturns the node that was appended.