Module 2: PHP & JS Flashcards

1
Q

How many times does this loop iterate?
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo (($a === $b) ? “yes” : “no”);

A

10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the expected output?
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo (($a === $b) ? “yes” : “no”);

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many times does this loop iterate?
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo ((round($a) === $b) ? “yes” : “no”);

A

10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the expected output?
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo ((round($a) === $b) ? “yes” : “no”);

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the tag for PHP?

A

<?php ?>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the tag for JavaScript?

A

 
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where does PHP run?

A

Server-side

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Where does JavaScript run?

A

Client-side

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

var

A

Function scope (less strict)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

let

A

Block scope (more restrictive)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

const

A

Block scope (also can’t be changed once set)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly