Questions LLC
Login
or
Sign Up
Ask a New Question
Javascript
Page 2
Questions (277)
What will this program output?
var flavors = []; flavors.push('lemon'); flavors.push('lime'); console.log(flavors);
1 answer
asked anonymously
45 views
What is the output of this program?
var a = 5; var b = 8; console.log(a + b);
1 answer
asked anonymously
63 views
Which keyword is used to declare a variable in JavaScript?
1 answer
asked anonymously
49 views
What is the output of this program?
var a = 5; a++; console.log(a);
1 answer
asked anonymously
81 views
What is the output of this program?
var flavors = []; flavors.push('lemon'); flavors.push('lime'); special = flavors[1];
1 answer
asked anonymously
54 views
Each line in JavaScript needs to end with a:
1 answer
asked anonymously
86 views
Which of these statements will print “Hello, world!” to the console?
(1 point) Responses console.log(“Hello, world!”);
1 answer
asked anonymously
48 views
Jsksksjdmmdjdiwiisks,
1 answer
asked by
Arsalan
131 views
Write a program that draws a random color square centered on the graphics canvas. The sides of the square should be SIDE_LENGTH.
1 answer
asked by
joe
26 views
Noelle is adding a timer to her game. She is using a script to update the timer using the delta time and text update functions.
1 answer
asked anonymously
130 views
Hunter is adding a credits prompt to a title screen. What function does Hunter add to the script to check for a specific
1 answer
asked anonymously
115 views
How many times will this program print "hello"?
var i = 50; while (i < 100) { println("hello"); } JavaScript 0 50 100 This code
1 answer
asked by
joe
30 views
The following code continually asks the user for a password until they guess the correct password, then ends. But there is one
1 answer
asked by
joe
44 views
Question: 3
How many times will the following program print "hello"? var i = 0; while(i < 10){ println("hello"); } JavaScript 10
1 answer
asked by
joe
28 views
What will the following program print when run?
for (var j = 0; j < 2; j++) { for (var i = 6; i > 4; i--){ println (i); } } 4 5 4
1 answer
asked by
joe
45 views
What is the last thing printed by the following program?
var start = 30; var stop = 10; for(var i = start; i >= stop; i-=5){ if(i
1 answer
asked by
joe
29 views
Question: 9
What is printed by the following program? var isRaining = false; var isCloudy = false; var isSunny = !isRaining &&
1 answer
asked by
joe
37 views
What will be the output of this program?
var number = 5; var greater_than_zero = number > 0; if (greater_than_zero){ if (number >
1 answer
asked by
joe
50 views
What is the value of the boolean variable canVote at the end of this program?
var age = 17; var isCitizen = true; var canVote =
1 answer
asked by
joe
40 views
What is the output of the following program?
var result = 0; var max = 5; for(var i = 0; i < max; i++){ result += i; }
1 answer
asked by
joe
35 views
What is printed by the following code?
function printNumbers(first, second, third){ println(first); println(second);
1 answer
asked by
joe
32 views
What are the parameters of the printNumbers function?
function printNumbers(first, second, third){ println(first);
1 answer
asked by
joe
36 views
If we want to draw a circle using our helpful drawCircle function at position (300, 400) with a radius of 40 and color blue,
1 answer
asked by
joe
27 views
What is printed when the following code is run?
function doubleNumber(x){ return 2*x; } function start(){ var y = 4; var doubledY
1 answer
asked by
joe
29 views
Question: 2
How many return values come out of the function sum? function sum(first, second){ var result = first + second; return
1 answer
asked by
joe
28 views
How many parameters go into the function sum?
function sum(first, second){ var result = first + second; return result; }
1 answer
asked by
joe
25 views
In the following code snippet:
function addTen(x){ var ten = 10; var result = x + ten; return result } function double(x){ var
1 answer
asked by
joe
42 views
Virtually all websites use JavaScript.
(1 point) Responses True True False
1 answer
asked by
LLLLLLLOOOOLLLLbot
52 views
Which one of these is the correct way to display the variable var, containing number 1 as value to the console?
1.print('1')
1 answer
asked anonymously
36 views
Question: 2
The following program should draw a circle on the screen 1 function start(){ 2 var circle = new Circle(40); 3
1 answer
asked anonymously
22 views
In the following code:
var size = 20; var x = 100; var y = 200; var ball = new Circle(size); ball.setPosition(x, y); JavaScript
1 answer
asked anonymously
29 views
We want to position a Circle circle on our canvas to be at a random position, but we want to keep the entire shape on the
1 answer
asked anonymously
15 views
What is the output of the following program?
function start(){ var x = 5; sumTo(x); println(x); } function sumTo(num){ var sum =
1 answer
asked anonymously
23 views
Question: 5
In the following function printThreeTimes: function printThreeTimes(word){ println(word); println(word);
1 answer
asked anonymously
21 views
What is printed by the following program?
function printNumbers(two, one, zero){ println(two); println(one); println(zero); }
1 answer
asked anonymously
22 views
What is printed by the following program?
function product(x, y){ return x * y; } function difference(x, y){ return x - y; }
1 answer
asked anonymously
23 views
Consider the following code snippet. What is returned and printed for the value of a?
function start(){ var a = mystery(10, 14);
1 answer
asked anonymously
23 views
Consider the code snippet:
function drawCircle(radius, color, x, y){ var circle = new Circle(radius); circle.setColor(color);
1 answer
asked anonymously
28 views
Question: 25
Which of the following is the correct way to create a function in JavaScript? function = myFunction()
1 answer
asked anonymously
15 views
Tell a Story
In this project, you’ll write a JavaScript program that tells a graphical story. Your job in this exercise is to
1 answer
asked anonymously
30 views
jsabfahajmcrapjdhvafsf
1 answer
asked anonymously
12 views
function start() {
move(); go(); go(); } function go() { move(); move(); } function go() { move(); move(); } JavaScript The go
1 answer
asked by
e
38 views
How can we improve the following program?
function start() { move(); move(); move(); move(); move(); move(); move(); move();
1 answer
asked by
e
42 views
Karel starts at Street 1, Avenue 1, facing East in a 5x5 world. What will happen after this code runs? Assume this is a
1 answer
asked by
e
47 views
How many total times will Karel move in this program?
function start() { move(); for (var i = 0; i < 5; i++) { move(); putBall();
3 answers
asked by
e
46 views
In this code, how many times is the dance function called and how many times is it defined?
function start() { move(); dance();
7 answers
asked by
e
38 views
In the following code, what would be a good Postcondition to write?
/* Precondition: Karel is on a spot with a tennis ball facing
3 answers
asked by
e
28 views
What is wrong with this for loop?
for (var i = 0, i < 10, i + 1) { move(); } JavaScript I. The for loop uses commas instead of
3 answers
asked by
e
65 views
What does the mystery function do?
function mystery() { while (noBallsPresent()) { move(); } } JavaScript Karel moves until it is
7 answers
asked by
e
34 views
Say Karel is on a location with one tennis ball. After the following code runs, how many tennis balls will there be at that
5 answers
asked by
e
46 views
Pages
1
2
3
4
5
6
Parent Categories (15)
Coding
Coding languages
Coding/Programming
Computer Programming
Computer Science/Programming
Front-end Development
Game Development
HTML
HTML/CSS
Programming
Programming Language
Programming Languages
Programming or Computer Science
Web Development
Web development languages