logo

Crowdly

You are given the section of code below, defining three variables. Based on y...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

You

are given the section of code below,

defining three variables. Based on your knowledge of javascript, what would you

describe the variable

pattern as (in one or two words)?

[2 marks]

let c =

document.getElementById("myCanvas");

let ctx = c.getContext("2d");

 

let pattern = [true,false,false,false,false,true,true,false,

               true,false,true,true,false,true,true,false,

               false,false,false,true,false,false,false,false,

               true,false,true,false,true,false,true,true,

               true,true,false,false,false,false,true,true,

               true,false,false,false,true,false,false,false,

               false,false,false,false,false,true,true,false,

               false,true,true,true,false,true,true,false,

               false,false,false,false,false,true,true,false];

 

The

variable pattern is used in order to draw a crossword puzzle (see image below). 

Why do you think the programmer has spread the variable over several lines? 

Would this cause a problem when running the program?

Explain your reasoning.

[4 marks]

Please answer all parts of the question.
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на modules.lancaster.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!