代码片段:varcanvas=document.createElement('canvas')document.getElementsByTagName('body')[0].appendChild(canvas)varctx=canvas.getContext('2d')varnumParticles=140