Aws
Auth
Axios
Admin
Angular
Android
Atom Payment
BPO
BcryptJs
Bootstrap
Basic Computer
C Language
C++
Css
Canva
Common questions
CorelDraw
Cloudinary
Content Writer
DSA
Django
Error
Excel
ExpressJs
Flutter
Github
Graphql
GoDaddy
HR
Html5
Hostinger
Jwt
Java
Json
Jquery
Javascript
Linux OS
Loopback API
MySQL
Manager
MongoDB
Marketing
MS Office
Mongoose
NodeJs
NextJs
Php
Python
Photoshop
PostgreSQL
PayU Payment
Paypal Payment
Redux
ReactJs
Router
React Native
React Router Dom
React Helmet
Sass
SEO
SMO
Stripe Payment
System Administrator
Software Testing
Typescript
Tailwind
Telesales
Tally
VueJs
Windows OS
XML
What is the `String.prototype.substr` method in JavaScript?
`String.prototype.substr` extracts a substring from a string based on a starting index and length. It returns the extracted substring. const str = 'hello world'; const substr = str.substr(6, 5); console.log(substr); // 'world'
`String.prototype.substr` extracts a substring from a string based on a starting index and length. It returns the extracted substring. const str = 'hello world'; const substr = str.substr(6, 5); console.log(substr); // 'world'
What is the `String.prototype.slice` method in JavaScript?
`String.prototype.slice` extracts a section of a string and returns it as a new string, without modifying the original string. const str = 'hello'; const sliced = str.slice(1, 4); console.log(sliced); // 'ell'
`String.prototype.slice` extracts a section of a string and returns it as a new string, without modifying the original string. const str = 'hello'; const sliced = str.slice(1, 4); console.log(sliced); // 'ell'