One Pager Cheat Sheet
- In this lesson, we will explore basic types of programming languages, focusing on the
string
type and operations defined on strings. - Strings in programming languages are a data type which is a
sequence of characters
that can be assigned to variables, accessed and manipulated using various properties and methods in order to perform various operations. - Strings in
JavaScript
can be declared using either single or double quotation marks, as demonstrated in the following code block. - Indexing is an important concept when manipulating strings, as they are indexed starting from
0
and not1
. - Yes, the
code block
is valid and declares a string with a value of"India"
. - Strings in most programming languages can contain both lowercase and uppercase letters, and
case
is important in the output of the code. - String operations are
defined
on different data types, including strings, to perform comparison, combination, removal, and addition of characters/strings. - In JavaScript, strings can be manipulated through
concatenation
,properties
such aslength
,indexOf
andtoLowerCase()
, as outlined in the documentation provided by the Mozilla Developer Network. - The code block combines two strings using
string concatenation
, resulting inSara12
as the output. - The code will output the index position of the letter
f
in theanimal
variable, which is4
. - Strings are immutable and must be declared with
double quotation marks
to includesingle quotation marks
inside. - We
learned
aboutstring operations
and theirbenefits
, which can help usmodify strings
without having to recreate them.