stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
TS, JS, CSS, HTML Flashcards | StudBud
Explore
/
TS, JS, CSS, HTML
TS, JS, CSS, HTML
27 terms
·
StudBud Administration
·
108 plays
Imported from external platform
Flashcards
27 cards
F
Practice quiz
P
Host live
L
Questions
27
Answers
1
How do we combat immutability in functional TypeScript?
mapping
spread operator
reduction
xor
2
What would I use if I wanted to conditionally modify items in a list?
filter
insertion
map
reduction
3
How can I get the following code to work functionally?
console.log(john.name)
JSON
unpacking
filtering
4
What keyword allows function access outside of the current file?
export
function
return
const
5
What is a null value?
value used to indicate something is “unknown”.
value used to indicate a value is not yet set.
is produced when you do math with numbers that are invalid
6
Which of the follow is a valid equality operator in TypeScript?
==
!==
====
!=
7
Arrays are implemented as Objects.
True
False
8
Which of the following are Arrays in JavaScript similar to?
Python Lists
C++ Arrays
Java Arrays
Python Dictionaries
9
JavaScript/TypeScript are purely functional languages.
False
True
10
Which of the following bits of code show a ternary IF
string === "red" ? if "red": "stop"; else if "yellow": "speed up"; "go";
prices.map((price: number): number => price*2);
prices.filter((price: number): boolean => price < 10);
age >= 21 ? "Can drink" : "Cannot drink";
11
What is the differences between var, let, and const?
var and let can be updated, let and const can not be redeclared
var can be redeclared, let can be updated, const can do neither
let is limited to "block-scope"
const, var, and let can be global
12
What is true about functional programming?
class methods manipulate state
organizes data and controls flow
functional calls determine state
everythings immutable!
13
How do I print to console?
System.out.println
cout
print
console.log
14
What is the any type?
A sketchy, shorter way of convincing TS that a piece of code is correct
A valid type checking method
A good way to avoid runtime errors and better test your program
A good replacement for an interface
15
When would I use let with an array?
In most situations. Its my go to default!
What?
if I plan to reassign references
when I never plan to change the value
16
What would be useful in averaging the items in a list?
reduction
filter
insertion
map
17
TS Interfaces have methods.
False
True
18
What does pricesInside.splice(3, 0, 4) do?
Inserts 4 at index 3
Inserts 3 at index 4
Inserts 4 at index 0
Inserts 3 at index 0
19
Which are equivalent to a TS "Record"?
Dictionaries
Tuples
Java Records
HashMaps
20
Which signature item is specific to lambda functions but not classic functions
=>
(param1: number, param2: number)
export
function
21
What is "truthiness"?
Something standardized across all programming languages
a value can be evaluated in a conditional context (True/False)
It's the word truth with a "ness" on the end
The same thing as an if statement
22
What is a NaN value?
is produced when you do math with numbers that is invalid
value used to indicate a value is not yet set.
value used to indicate something is “unknown”.
23
...nums returns [1, 2, 3]
False
True
24
What is the best way to append to an array?
push
append
using const
spread operator
25
What would I use if I wanted to change all items in a list to decimal format?
insertion
filter
reduction
map
26
What are the three primitive types in TypeScript?
boolean, number, string
boolean, float, string
boolean, integer, string
boolean, number, char
27
What is the explanation for expect(countFangs(0)).toBe(1);?
Calls countFangs with the argument 0 & checks the return value to also be 1
A problematic way to test functions
Calls countFangs with the argument 1 & checks the return value to also be 0
A function that adds one "fang" to the argument