MCQs > IT & Programming > JavaScript > Which code snippet is best way to clear the canvas for redrawing?

JavaScript MCQs

Which of the following code snippets is best way to clear the canvas for redrawing?

Answer

Correct Answer: var canvas = document.getElementById('canvasId'); var context = canvas.getContext('2d'); ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.restore();

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it