Загрузка...

Strings Properties, Methods - LECTURE 2| JavaScript Full Course | JavaScript for Beginners | #js

Live Javascript course: https://learn21.in/course/javascript-for-beginners

Javascript - Strings

String
Collection of characters, text, always in quotes var a = “hello world” // a is a variable here
a
. ’hello world’
• typeof a
• . “string”
So a is an object of type ‘str’

Basic String methods

• • • •
a.length // 11
Defining string as an object
var firstName = new String(“John");
typeof firstName // “object”
str.indexOf(“l”) // returns the index of (the position of) the
HELL0 WORLD
0 1 2 3 4 5 6 7 8 9 10 String indexing
first
occurrence

• • •
• •
String Methods
a.slice(1, 3) // returns a part of the string “el”
a.replace(“world”,”country”) // replaces a part of the string with another string
a.toUpperCase() // upper cases all characters - a.charAt(0) // returns character at index


• • • •

Find last 2 characters of any given string
a = “Joker” // “er”
a = “Bang bang” // ng
a = “Red Lapse” // se
Write a JavaScript function to split a string and convert it into an array of words
Hint use string splicing + indexing
Small Task


string is blank or not.
Problems
Write a JavaScript function to check whether a
Write a JavaScript function to extract a specified

number of characters from a string.

▶️ You Can Find Us On:
Website - https://learn21.in/
Telegram channel: https://t.me/learn21_in
Twitter - https://twitter.com/21_learn
LinkedIn - https://www.linkedin.com/company/learn-21

#javascript #jsprogramming #programmers #github #coding #nodejs #reactjs #codinglife #html #coder

Видео Strings Properties, Methods - LECTURE 2| JavaScript Full Course | JavaScript for Beginners | #js канала Learn21 Academy
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять