JavaScript Tutorial For Beginners #24 - Strings

preview_player
Показать описание
Hey all, so far we've looked at two data types in JavaScript - Boolean types (true or false) and number types. In this tutorial I want to talk about a third data type - strings. Strings are essentially a string of characters, be them numbers to make a phone number, or letters to make a word or phrase, or even a combo of both.

Strings have a lot of methods (built in functions) you can call on them, and we'll look at a few of them in this tutorial too.

As always, if you have any questions, just fire away :).

========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

========== Social Links ==========

Комментарии
Автор

"abc" is greater than "Bcd" because the capital letters comes first in the ASCII Table then the small letters
so that "a" value in ASCII = 97
while "B" = 66
97 > 66
...
Really, really thanks for your tutorials.
You're great

ameedsayeh
Автор

I just wanted to let you know your videos are so incredbily useful! I am in the middle of a career change and start a coding camp for web development next week. I'm very excited for it and you have really helped me learn the fundamentals! Thank you so much!

joshuagerloff
Автор

Thanks Man! I begin to learn and I must say that your videos are so helpful!! :)

vuja
Автор

I think the uppercase letters being before lowercase comes from their Unicode values rather than JavaScript, and I guess a way to remember it is that you'd always write a capital letter before lowercase letters which come after it.

mattstyles
Автор

still watching and learning from this video in 2023, really appreciate your work

iashish
Автор

var fromMe = "Thanks, mate!"


brocklesnarufcchamp
Автор

"abc" is greater than "Bcd" because of their ascii values
ascii value of a=97
ascii value of B=66
66<97

yaswanthmareedu
Автор

Sound of your keyboard is very nice :D. Great work dude.

pankierownik
Автор

Capital letters have smaller value than lower letters. So while a < b returns TRUE, a < B returns FALSE.... If it helps to anyone, I put it to my mind like this, imagine you are assigning numbers, starting with the UPPERCASE alphabet, and we contunied assigning numbers for the lowercase charachters. So A 1, B 2, C 26, a 27, b 28, c So in that case Ben Lim's comment below makes more sense. And also as Ameed mentioned in his comment, but if you dont want to check ascii value. This could be a good way to keep it in mind.

MsSuis
Автор

Totally get what you're saying, but in my opinion, I quite like that lowercase letters are greater than their capital letter counterparts. By now camel case has become embedded in my head wherein lowercase always precede uppercase e.g., camelCaseLetters. Maybe this will help other people remember as well :)

joshrochon
Автор

Instead of typing myString = 'I\'m a "fun" string' and having to deal with the escape character, single and or double quotes you could type myString = "I’m a “fun” string" provided that the used font includes the typographically correct symbols for apostrophe and quotation marks. How to enter these symbols depends on the operating system used. You can look it up online how to do that.

ado
Автор

var explanation = great;
console.log(explanation);

aakashgupta
Автор

What is the website you referred to with the other methods on strings you didn't include it in your description? Thanks in advance these videos are great!

kel
Автор

abc>Bcd Because ASCII Code value of "a" is greater than "B".

harendrasinghpratap
Автор

In case anyone didn't know, when comparing single alphabets (z or Z) has the highest value. With lower case having the highest value. Try this out in console:

e.g 1
var a = "z"
var b = "a"
a > b = true

e.g 2
var a = "Z"
var b = "A"
a > b = true

var a = "z"
var b = "ABCDE"
a > b = true

EricCartmanFTW
Автор

for IndexOf - Index is starting from 0, am I right?

ishwaryap
Автор

how to display a variable inside quotation mark in JS

windowsclip
Автор

"I ain't not no undummy"
-Homer Simpson

artokilponen
Автор

+thenetninja What line of code will give you a random number between 1 and 30 (for example) in JavaScript?

thewebmaster
Автор

8:00


Why did you put .toLowerCase with string1 if the string is already lower case?


Just curious.

chito_