Last active
October 8, 2020 04:24
-
-
Save shiburagi/0fea13b6e6cc502056f06d4b49006dfc to your computer and use it in GitHub Desktop.
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
// String to Characters | |
const list = [..."abc"] //["a","b","c"] | |
// String to ASCII Code | |
const list = [..."abc"].map(e=>e.codeUnitAt()) //[97,98,99] | |
// Split String | |
const list = "a;b;c".split`;` //["a","b","c"] | |
// Join List | |
const string = ["a","b","c"].join`;` //"a;b;c" | |
// String to Number | |
const number = "10"*1; //10 | |
const number = "10.5"*1; //10.5 | |
// Null handler | |
const x=null||10; //10 | |
const x=0||10; //10 | |
const x=false||10; //10 | |
const x=true||10; //true | |
const x="abc"||10; //"abc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment