1let str = "12345.00";
2str = str.substring(0, str.length - 1);
3console.log(str);
1const array = [2, 5, 9];
2
3console.log(array);
4
5const index = array.indexOf(5);
6if (index > -1) {
7 array.splice(index, 1);
8}
9
10// array = [2, 9]
11console.log(array);
1?? (The Nullish Coalescing Operator)
2
3const foo = null ?? 'default string';
4console.log(foo);
5// expected output: "default string"
6
7const baz = 0 ?? 42;
8console.log(baz);
9// expected output: 0
10