javascript substring last character
var hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//dconst id = "ctl03_Tabs1";
console.log(id.slice(id.length - 5)); //Outputs: Tabs1
console.log(id.slice(id.length - 1)); //Outputs: 1'abc'.slice(-1); // c
Also in JavaScript:
- reusable table in react js
- react mui icons
- moment add 30 days
- how to change background color in javascript w3schools
- count word and space in text javascript
- jquery preload images
- format number thousands k javascript
- jsx if block
- To set the text of button using Jquery
- get hash from url
- angular one array contains any of second
- how to run node js on mac
- nativescript vue back button handler
- parseint array javascript
- keydown event in javascript
- how to check if a number is even or odd in javascript
- javasript array indexof
- document.title you clicked count times
- .on change get value
- form validation in react functional component
- Access to fetch at 'https://api.myip.com/' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-
- javascript set color in hex
- detect a click outside an element javascript
- javascript update attribute