1
00:00:00,000 --> 00:00:02,960
I set party to false.

2
00:00:02,960 --> 00:00:05,800
Why is my website still throwing confetti?

3
00:00:05,980 --> 00:00:08,220
Because the URL gives you a string.

4
00:00:08,220 --> 00:00:10,140
Boolean doesn't read English.

5
00:00:10,140 --> 00:00:12,430
Every non-empty string is truthy.

6
00:00:12,430 --> 00:00:13,580
Even false.

7
00:00:13,760 --> 00:00:16,470
So double exclamation marks

8
00:00:16,470 --> 00:00:17,480
won't fix it?

9
00:00:17,660 --> 00:00:18,980
Same conversion.

10
00:00:18,980 --> 00:00:20,580
Parse the value instead.

11
00:00:20,580 --> 00:00:22,650
Accept true. Accept false.

12
00:00:22,650 --> 00:00:24,080
Reject anything else.

13
00:00:24,080 --> 00:00:27,140
Here, a missing parameter defaults to false.

14
00:00:27,320 --> 00:00:28,950
Read party from the URL,

15
00:00:28,950 --> 00:00:30,360
then call the parser.

16
00:00:30,360 --> 00:00:32,780
Same URL, party equals false.

17
00:00:32,780 --> 00:00:34,500
Now the confetti stops.

18
00:00:34,500 --> 00:00:36,000
Uppercase and empty strings

19
00:00:36,000 --> 00:00:37,600
are rejected in this example.

20
00:00:37,780 --> 00:00:39,020
Great.

21
00:00:39,020 --> 00:00:41,860
My feature flag was a party invitation.
