javascript get last character of string
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hellvar hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//d
Also in JavaScript:
- javascript get elements that exist in two arrays
- jquery steps next button event
- devextreme custom field
- lifecycle methods react
- vue js getter
- sorting array of objects in javascript by using select option
- react how to export component
- jquery move element
- angular with intercepter
- how to use if else statement in javascript
- mvc set javascript variable from model
- How to make add cooldowns to a command in discord.js
- Delete Properties from a JavaScript Object
- javascript reload page
- express js example
- how to debug node js file in webpack
- change inside div with jquery
- react native scrollview fixed header
- set up background process in express app
- let scores = [80, 90, 70]; for (const score of scores) { console.log(score); }
- how to print console in javascript
- onclick open link js
- javascript get n random elements from array
- js swap