This commit is contained in:
@@ -33,6 +33,14 @@
|
||||
console.log(zahl4); // => '10.5'
|
||||
|
||||
const outputEl = document.querySelector('.output') || console.warn('Element existiert nicht');
|
||||
|
||||
// const slider = (el = null, opts) => {
|
||||
// const selector = el || document.querySelector('.slider');
|
||||
|
||||
// // more logic
|
||||
// };
|
||||
|
||||
// slider(document.querySelector('.my-slider'));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
// toggle = false;
|
||||
// }
|
||||
|
||||
// toggle = !toggle ? true : false;
|
||||
//toggle = !toggle ? true : false;
|
||||
|
||||
toggle = !toggle; // => !(false) -> true | !(true) -> false
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
// String - Methode str.indexOf('searchValue' [, position]) - optionaler Parameter
|
||||
|
||||
console.log('name.indexOf("a", 2): ', name.indexOf('a', 2)); // => 6
|
||||
console.log('lorem ipsum'.indexOf('m', 5)); // => 10
|
||||
|
||||
// Strign - Methode str.lastIndexOf('searchValue')
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="container py-5">
|
||||
<h1>
|
||||
<a href="https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/String/substr"
|
||||
>String.substr(startIndex, length) DEPREACATED</a
|
||||
>String.substr(startIndex, length) DEPRECATED</a
|
||||
>
|
||||
</h1>
|
||||
<p>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
// String - Methode str.charAt(index)
|
||||
|
||||
console.log('Lisa Simpos'.charAt(0)); // => 'L'
|
||||
console.log('Lisa Simpon'.charAt(5)); // => 'S'
|
||||
console.log('Lisa Simpons'.charAt(5)); // => 'S'
|
||||
|
||||
// Default-Wert bei keiner Angabe ist 0
|
||||
console.log('Lisa Simpos'.charAt()); // => 'L'
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
// str.replaceAll - seit Juni 2021
|
||||
outputEl.textContent = productDescription.replaceAll(productName, newProductName);
|
||||
|
||||
console.log('I love JS. JS is the best language'.replace('JS', 'TS'));
|
||||
// => 'I love TS. JS is the best language'
|
||||
|
||||
console.log('I love JS. JS is the best language'.replace(/JS/g, 'TS'));
|
||||
// => 'I love TS. TS is the best language'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user