This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* OnePress Child Theme Functions | |
* | |
*/ | |
/** | |
* Enqueue child theme style | |
*/ | |
add_action( 'wp_enqueue_scripts', 'onepress_child_enqueue_styles', 15 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
if (true) { | |
let insideJoke = 174; // let used -> block's scope | |
const anotherInsideJoke = 100; // const used -> block's scope | |
var thisIsACommonJoke = 42 // var used -> scope to outer scope (global) | |
} | |
console.log('thisIsACommonJoke', thisIsACommonJoke); // ok, global scope | |
console.log('insideJoke', insideJoke); // error: out of scope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// how to get the index of the max/min element in an array | |
let scores = [2, 0, -1, 7, 1]; | |
console.clear(); | |
let scoreIndex = scores.reduce( | |
(iMax, x, i, arr) => x > arr[iMax] ? i : iMax, 0); | |
console.log('calc max index', scoreIndex); |