1) Which symbol is used to assign a value to a variable? a) == b) = c) += d) === 2) What does a boolean value represent? a) True or False b) Number c) Text d) Array 3) Which keyword declares a variable? a) var b) let c) const d) All of the above 4) What is the purpose of an if-else statement? a) Make decisions b) Repeat actions c) Define functions d) Create loops 5) Which loop runs as long as the condition is true? a) for loop b) while loop c) do-while loop d) if statement 6) What library is used for creating sprites in p5.js? a) p5.play b) p5.sprites c) p5.graphics d) p5.objects 7) What property might you change to move a sprite? a) x position b) color c) size d) velocity 8) How do you compare two values for equality? a) = b) == c) === d) != 9) What is a function? a) A reusable block of code b) A type of variable c) A loop structure d) A data type 10) Which keyword is used to define a function? a) function b) def c) func d) declare 11) What does the 'for' loop do? a) Repeats a block b) Makes decisions c) Defines variables d) Creates sprites 12) Which property defines the size of a sprite? a) width b) height c) size d) scale 13) What is the main use of the p5.js library? a) Graphics and interaction b) Data processing c) Networking d) Sound editing 14) Which of these is a data type? a) Number b) Boolean c) String d) All of the above 15) What does the 'else' part do in an if-else statement? a) Provides an alternative b) Repeats code c) Defines a variable d) Creates a loop 16) How do you start a while loop? a) while (condition) b) do (condition) c) loop (condition) d) repeat (condition) 17) What is a sprite? a) A game object b) A type of variable c) A function d) A loop 18) What is the purpose of functions? a) Reuse code b) Organize code c) Simplify tasks d) All of the above 19) Which of these adds one to a variable? a) variable++ b) variable = variable + 1; c) varibale += 1 d) All of the above 20) Which of these subtracts 5 to a variable? a) variable -= 5; b) variable += 5; c) variable *= 5; d) Subtract 5
0%
JavaScript Basics Quiz for 8th Grade
共用
共用
共用
由
Mightymrhansen
8th Grade
Computing
編輯內容
列印
嵌入
更多
作業
排行榜
顯示更多
顯示更少
此排行榜當前是私有的。單擊
共用
使其公開。
資源擁有者已禁用此排行榜。
此排行榜被禁用,因為您的選項與資源擁有者不同。
還原選項
迷宮追逐
是一個開放式範本。它不會為排行榜生成分數。
需要登錄
視覺風格
字體
需要訂閱
選項
切換範本
顯示所有
播放活動時將顯示更多格式。
打開結果
複製連結
QR 代碼
刪除
恢復自動保存:
?