Question

1. var s = "A red boat"; var a = s.split(" "); what is the value...

1.

var s = "A red boat";

var a = s.split(" ");

what is the value of a?

var b = [9, 3, 2, 1, 3, 7];

var c = b.slice(2, 5);

What is the value of c?

var d = c.concat(a);

alert(d.join("**"));

[ 'A', 'red' , 'boat']
[ 2 , 1, 3]
2**1**3**A**red**boat

[ 'A', 'red' , 'boat']
[ 1 , 3, 7]
8**A**red**boat

[ 'A', 'red' , 'boat']
[ 3 , 2, 1]
A**red**boat

[ 'A', 'red' , 'boat']
[ 3 , 1, 2]
A**red**boat

2.

var a = [9, 3, 2, 1, 3];

a[20] = 6;   

console.log(a.length);

a.length = 10;

console.log(a);

a.length = 3;

console.log(a);

What is the printed as output?

20
[9, 3, 2, 1, 3, , , , , , , , , , , , , , , , ]
[9, 3, 2, 1, 3, , , , , ]
[9, 3, 2]

21
[9, 3, 2, 1, 3]
[9, 3, 2, 1, 3]
[9, 3, 2]

20
[9, 3, 2, 1, 3, , , , , , , , , , , , , , , , , 6]
[9, 3, 2, 1, 3, , , , , ]
[9, 3, 2, 1, 3]

21
[9, 3, 2, 1, 3, , , , , , , , , , , , , , , , , 6]
[9, 3, 2, 1, 3, , , , , ]
[9, 3, 2]

3.

var a = [];

var b = [3, 5];

b.push(2);   

b.unshift(7);   

a.push(3, 10, 5);   

a.reverse();   

console.log(a.pop());

console.log(a.shift());

b.push(a[0], 1);

b.sort();

console.log(b);

3
5
[1, 10 , 2]

3
5
[1, 10 , 2 , 3, 5 , 7]

5
3
[1, 10 , 2 , 3, 5 , 7]

3
5
[3, 5 ,7,1,10,2]

4.

var a = [9, 4, 1, 7, 8];

var b = a.slice(2);

console.log(b);

var c = a.slice();

console.log(c);

[9, 4, 1, 7, 8]

[9, 4, 1, 7, 8]

[1,7,8]
[1,7,8]

[1,7,8]
[9,4,1,7,8]

[1]
[9, 4, 1, 7, 8]

5.

var days = ["p\u014d\u02bbakahi", "p\u014d\u02bbalua",

"p\u014d\u02bbakolu", "p\u014d\u02bbah\u0101",

"p\u014d\u02bbalima", "p\u014d\u02bbaono",

"l\u0101pule"];

console.log(days[0]);

console.log(days[3]);

console.log(days[6]);

lapule
po'akahi
po'aha

po'akahi
undefined
NaN

po'akahi
po'aha
lapule

po'akahi
NaN
NaN

6.

var protoCircle = {x: 0, y: 0, radius: 1, color: "black"};

var c1 = Object.create(protoCircle);

c1.x = 4;

c1.color = "green";

console.log(c1.x);

console.log(c1.y);

console.log(c1.color);

console.log(c1.radius);

0
0
black
1

0
0
green
1

4
0
green
1

4
0
black
1

7.

var s1 = "Hello";

"Hello".toUpperCase();

var s2= "World";

"World".toUpperCase();

var s3= s1+s2;

Question 7 options:

HelloWORLD

HELLOWORLD

HelloWorld

HELLOWorld

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Question 1:
[ 'A', 'red' , 'boat']
[ 2 , 1, 3]
2**1**3**A**red**boat

Question 2:
21
[9, 3, 2, 1, 3, , , , , , , , , , , , , , , , , 6]
[9, 3, 2, 1, 3, , , , , ]
[9, 3, 2]

Question 3:
3
5
[1, 10 , 2 , 3, 5 , 7]

Question 4:
[1,7,8]
[9,4,1,7,8]

Question 5:
po'akahi
po'aha
lapule

Question 6:
4
0
green
1

Question 7:
HelloWorld

Note: Please comment below if you have any doubts. upuote the solution if it helped. Thanks!

Add a comment
Know the answer?
Add Answer to:
1. var s = "A red boat"; var a = s.split(" "); what is the value...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 13) The value of the resistance R1 of colors (Red, Black, Black, and Gold) is: Red...

    13) The value of the resistance R1 of colors (Red, Black, Black, and Gold) is: Red Black Gold Gold: 5% Silver 1023 (A) (2052) 22 (B) (20:1) (C) (200+ 10) 2 (D) (2007 20) 2 (E) (27 0.1) Black: 0 Brown: 1 Red: 2 Orange : 3 Yellow : 4 Green: 5 Blue : 6 Violet:7 Gray: 8 White: 9 14) Which of the following equations is correct when applying Kirchhoff loop rule for the circuit shown below (A) 6...

  • Three resistors with color codes 1. Brown, Brown, Brown, 2. Red, Red, Red 3. Orange, Black,...

    Three resistors with color codes 1. Brown, Brown, Brown, 2. Red, Red, Red 3. Orange, Black, Orange are connected in parallel. A battery of voltage 4.5 V is connected to the resistors. a) Draw the circuit diagram. b) List the values of the resistors according to color code. c) Calculate the equivalent resistance 1st Digit d) Find the current through each resistor e) Add the currents through each resistor to find the total current and use the voltage to find...

  • Q1. Find measurement of resistors: Resistor 1: blue - violet - black - orange - gold...

    Q1. Find measurement of resistors: Resistor 1: blue - violet - black - orange - gold Resistor 2: orange-orange-brown-brown-red Resistor 3: orange-orange - red -red-gold Resistor 4: blue - violet - red - brown - gold Resistor 5: yellow - red - brown-brown-silver Q2. What color code designates: 52, 10% Color Black Brown Red Orange Yellow Green Blue Violet Digit Multiplier Tolerance (%) 0 10° (1) 1 L 10 2 10% 3 103 4 104 5 10 0.5 6 0.25...

  • Please help. Part 3: Using the color coding for resistors, determine the resistance and the tolerance...

    Please help. Part 3: Using the color coding for resistors, determine the resistance and the tolerance for the following 3 resistors: exornn Rbolor coding: brown, black, yellow, gold Rgcolor coding: red, violet, orange, gold Rocolor coding: orange, orange, orange, gold The chage nowng thonuh a sece is every themes Find out the outest throsgh the sistance is diven e well se the colot code fur esch of the resistors 4-Band-Code 2%, 5%, 10% 560k Ω 5% 1ST BAND | 2ND...

  • Here is a table showing a 52 cards in a standard deck Color Suit Ace Two...

    Here is a table showing a 52 cards in a standard deck Color Suit Ace Two Three Four Five St Seven Eight Mine Ten Back Queen King Red Hearts AY 22 3 4 5 6 7 8 9 104 0 Red Diamonds A 2 3 4 5 6 7 9+ 10+ + + + Black Spades At 2 3 4. 5. 6. 7. 8. 9. 10. 1. 0 K. Black Clubs A. 2. 3. 4. 5. 6. 7 8 9...

  • 1. Given the following array, what is the value of pets[3]? var pets = new Array("giraffe",...

    1. Given the following array, what is the value of pets[3]? var pets = new Array("giraffe", "pig", "beetle", "hamster", "spider", "goldfish", "cow"); A. pig B. beetle C. hamster D. spider 2. Given the following array, which statement will create a variable named product that multiplies 4 * 5, using array elements? var nums = new Array(2, 3, 4, 5, 6, 30, 40, 50, 60); A. var product = nums[1] * nums[2]; B. var product = nums[2] * nums[3]; C. var...

  • There are 5 red marbles, 7 green marbless, 4 black marbles, and 8 blue marbles in...

    There are 5 red marbles, 7 green marbless, 4 black marbles, and 8 blue marbles in a bag. Suppose you select one marble at random. Find each probability. a. P(red) b. P(orange) c.P(blue) d. P(not green) d. P(green or black) eP(not yellow)

  • Question 46 2 pts Which of the following is incorrect about a red-black tree? Group of...

    Question 46 2 pts Which of the following is incorrect about a red-black tree? Group of answer choices a. The leaves are always red b. A red-black tree is equivalent to a 2-4 tree c. A red node must have a black parent d. Every path from the root to the leaves must have the same number of red nodes e. a and d Flag this Question Question 47 2 pts Given the following maxheap, assuming heap entries start at...

  • this is the last problem. 6. A jar contains 5 red balls and 5 black balls....

    this is the last problem. 6. A jar contains 5 red balls and 5 black balls. Two balls are successively drawn from the jar. After the first draw the color of the ball is noted, and then the selected ball is returned to the jar together with another ball of the opposite color. In other words, if a red ball is drawn it is returned to the jar together with another black ball; if black ball is drawn it is...

  • In the American version of the Game Roulette, a wheel has 18 black slots, 8 red...

    In the American version of the Game Roulette, a wheel has 18 black slots, 8 red slots and 2 green slots.  All slots are the same size.  In a carnival game, a person wagers $2 on the roll of two dice.  A person can wager on either red or black.  Green is reserved for the house. If a player wagers $5 on either red or black and that color comes up, they win $10 otherwise they lose their wager.  What is the expected value of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT