Skip to content

Instantly share code, notes, and snippets.

View chnbohwr's full-sized avatar
🐳
Enjoy development fun 享受開發樂趣

HsuChing(Hyman) chnbohwr

🐳
Enjoy development fun 享受開發樂趣
View GitHub Profile
@chnbohwr
chnbohwr / getNestedValue.js
Created August 29, 2018 03:47 — forked from bbandydd/getNestedValue.js
get Nested Object value without using if conditions
const obj = {
a: {
b: {
d: 2
},
c: {
e: 5
}
}
};
@chnbohwr
chnbohwr / .gitignore
Created February 21, 2017 14:22 — forked from rjmunro/.gitignore
gitignore for cordova cli projects
# Android
platforms/android/assets/www
platforms/android/bin/
platforms/android/gen/
platforms/android/res/xml/config.xml
# iOS
platforms/ios/build/
platforms/ios/CordovaLib/build/
platforms/ios/www
@chnbohwr
chnbohwr / gist:6d9dae6650d297620372eda01ea502b4
Created May 27, 2016 02:10 — forked from chad3814/gist:2924672
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]