Introduction + charAt method | String Object In JavaScript

preview_player
Показать описание
🎁 Join my channel to get access to perks:

🧡 Hello All JavaScript Lovers Outhere!

Today you're going to learn about the String Object In JavaScript.

This tutorial is a series of videos, in each video we will discuss a method (or more) of the String Object in JavaScript.

In today's video, you're going to learn how to create a string primitive and a string object in JavaScript, and the difference between them, and that JavaScript automatically convert a string primitive to a string object, so you can have access to all the string object methods and properties.

We will discuss the length property of string, and that it's basically the number of characters in a string.

You will also learn that strings are zero index based, which means that the first character in a string has the index zero. and because strings can be treated like arrays, we can access each character by using the index via the square brackets ( [index] ).
Example:
const str = "Code Explained";

You will also learn how to use the charAt method to access a character for a given string.

🕔 Timeline :
00:00:00 - Intro
00:00:39 - Create a string
00:02:04 - String Length Property
00:02:52 - Access String Character
00:04:39 - charAt method

🌍 Social Media Links.

💲 Suppport the Channel
Рекомендации по теме
Комментарии
Автор

You should make complete Javascript tutorial. Trust me I have never seen such effort from any tutor.

ferdause
Автор

You should've made complete summaries for all js concepts methods with a summary concepts intro video
I've watched the all 33 array methods and i can tell you from a learner stand point this is the highest quality you can present concepts even though most people might not realize it even if they see your vid title

tykfnzg
Автор

Thanks, man!
Bro, can you help me with this question?
If I got an array of strings that I do not want to make visible if a user selects, for example, a "product" that its "id" is inside that array. Is it possible to verify that and then return "false" or "true" in ternary condition? Can I use the "includes()" method?

viniciusm.m.
Автор

CASE 1 - string primitive in a variable:
I would add that when JS internally transforms a string primitive to a String object via “wrapping”, it does so only for the few milliseconds needed to access the method we specify. The string primitive has no methods of its own, but the String object wrapper does. After the method executes, the wrapper is then shed and we revert back to an immutable string primitive. The String object wrapper is then garbage collected. This “wrapping”, i.e. the String object creation / destruction / garbage collection cycle, repeats every time we apply another method to the string primitive.

CASE2 - String object (via constructor function) in a variable
The string primitive is passed as an argument (i.e. a variable) to the constructor function. The String object is created and it persists as an object. We can now access methods at will, i.e the “wrapping” creation / destruction / garbage collection processes are N/A after the constructor creates the String object. Internally, the immutable string primitive also persists.

stephen