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 代码
删除
恢复自动保存:
?