angular js w3school code example

Example 1: javascript use strict

// Whole-Script Strict Mode Syntax
'use strict';
var v = "Hi! I'm a strict mode script!";

Example 2: splice javascript

const months = ['Jan', 'March', 'April', 'June'];
months.splice(1, 0, 'Feb');
// inserts at index 1
console.log(months);
// expected output: Array ["Jan", "Feb", "March", "April", "June"]

months.splice(4, 1, 'May');
// replaces 1 element at index 4
console.log(months);
// expected output: Array ["Jan", "Feb", "March", "April", "May"]

months.splice(0, 1);
// removes 1 element at index 0
console.log(months);
// expected output: Array ["Feb", "March", "April", "May"]

Example 3: angular javascript

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.9/angular.min.js" defer></script>

Example 4: use strict javascript

function doSomething() {
    'use strict';
    ...
}