1.

What is the returning value of the getContext() method?(a) Drawing model(b) CanvasRenderingContext2D object(c) Context2D object(d) ContainerI got this question in my homework.My question comes from Graphics in division Graphics and Rendering of JavaScript

Answer»

Correct CHOICE is (b) CanvasRenderingContext2D object

Easy explanation: Call GETCONTEXT() with the argument “2d” to obtain a CanvasRenderingContext2D object that you can use to DRAW two-dimensional graphics into the canvas. It is important to understand that the canvas ELEMENT and its context object are two very different objects.



Discussion

No Comment Found

Related InterviewSolutions