JavaScript Hapus karakter terakhir dari string
var str = 'mystring';
// the character 'g' will be removed
str = str.slice(0, -1);
Coding Random Things
var str = 'mystring';
// the character 'g' will be removed
str = str.slice(0, -1);
let str = "Hello Worlds";
str = str.slice(0, -1);
str = "hello I'm McDown...";
newStr = str.substring(0, str.length - 3); // Returns "hello I'm McDown"
var str = 'mystring';
// the character 'g' will be removed
str = str.slice(0, -1);
let str = "12345.00";
str = str.slice(0, -1);
console.log(str);
var string = "RandomString";
var slicedString = string.slice(0, -1);
maram