This file contains hidden or 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
const user = { | |
name: 'John Ludwig', | |
gender: 'Male' | |
}; | |
const college = { | |
primary: 'Mani Primary School', | |
secondary: 'Lass Secondary School' | |
}; |
This file contains hidden or 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
myArray.filter(Boolean); | |
// OR, IF YOU WANT TO MAKE MODIFICATIONS ON THE FLY | |
myArray | |
.map(item => { | |
// Do your changes and return the new item | |
}) | |
.filter(Boolean); |
This file contains hidden or 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
const array = [1, 1, 2, 3, 5, 5, 1] | |
const uniqueArray = [...new Set(array)]; | |
console.log(uniqueArray); // Result: [1, 2, 3, 5] | |
// OR | |
let uniqueArray = [...new Set([1, 2, 3, 3,3,"school","school",'ball',false,false,true,true])]; | |
>>> [1, 2, 3, "school", "ball", false, true] |
This file contains hidden or 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
const isRequired = () => { throw new Error('param is required'); }; | |
const print = (num = isRequired()) => { console.log(`printing ${num}`) }; | |
print(2);//printing 2 | |
print()// error | |
print(null)//printing null |
This file contains hidden or 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
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 |
This file contains hidden or 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
{ | |
"scripts": [], | |
"showConsole": true, | |
"template": true | |
} |
This file contains hidden or 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
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage | |
@{ | |
var homePage = Model.Content.Site(); | |
} | |
@helper RenderChildPages(IEnumerable<IPublishedContent> pages) | |
{ | |
if (pages.Any()) | |
{ | |
<ul> |
NewerOlder