Search Header Logo

Salesforce 31 Oct 2023

Authored by Sangeeta Ghosh

Computers

Professional Development

Used 3+ times

Salesforce 31 Oct 2023
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How Many Future methods can be defined in a Class?

20

30

500

Any number of. There are no restrictions as such.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

function sayHi() {

console.log(name);

console.log(age);

var name = 'Lydia';

let age = 21;

}

sayHi();

Lydia and undefined

Lydia and ReferenceError

ReferenceError and 21

undefined and ReferenceError

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

for (var i = 0; i < 3; i++) {

setTimeout(() => console.log(i), 1);

}

for (let i = 0; i < 3; i++) {

setTimeout(() => console.log(i), 1);

}

0 1 2 and 0 1 2

0 1 2 and 3 3 3

3 3 3 and 0 1 2

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What's the output?

+true; !'Lydia';

1 and false

false and NaN

false and false

Answer explanation

The unary plus tries to convert an operand to a number. true is 1, and false is 0.

The string 'Lydia' is a truthy value. What we're actually asking, is "is this truthy value falsy?". This returns false.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What's the output?

let greeting;

greetign = {}; // Typo!

console.log(greetign);

{}

ReferenceError: greetign is not defined

undefined

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What's the output?

function sum(a, b)

{

return a + b;

}

sum(1, '2');

NaN

TypeError

"12"

3

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What's the output?

let number = 0;

console.log(number++);

console.log(++number);

console.log(number);

1 1 2

1 2 2

0 2 2

0 1 2

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?