Strings in JavaScript (OCR A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
9 cards from this deck
ShowHide
Practise the cards
9 cards from this deck
What are strings in JavaScript?
What are strings in JavaScript?
Sequences of characters used for text
String property for length
String property for length
.length
Three common string methods
Three common string methods
.substring(), .toUpperCase(), .toLowerCase()
.toUpperCase() purpose
.toUpperCase() purpose
Converts string to uppercase
.toLowerCase() purpose
.toLowerCase() purpose
Converts string to lowercase
'JavaScript'.length output
'JavaScript'.length output
10
'JavaScript'.toUpperCase() result
'JavaScript'.toUpperCase() result
'JAVASCRIPT'
Common string comparison mistake
Common string comparison mistake
Using == instead of ===
Correct operator for strict equality
Correct operator for strict equality
===
