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

preview_player
Показать описание

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

• • • •
Defining string as an object
var firstName = new String(“John");
typeof firstName // “object”
HELL0 WORLD
0 1 2 3 4 5 6 7 8 9 10 String indexing
first
occurrence

• • •
• •
String Methods


• • • •

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:

#javascript #jsprogramming #programmers #github #coding #nodejs #reactjs #codinglife #html #coder
Рекомендации по теме
join shbcf.ru