Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| programming:javascript [2024/01/21 12:47] – [Javascript JSON] admin | programming:javascript [2025/03/31 18:02] (current) – [Programming Javascript JS ES] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Interesting JS ES ====== | ====== Interesting JS ES ====== | ||
| + | * standard for development https:// | ||
| * es levels support (es6 es next) https:// | * es levels support (es6 es next) https:// | ||
| * https:// | * https:// | ||
| Line 10: | Line 11: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | |||
| + | ====== Data Visualization ====== | ||
| + | * https:// | ||
| ===== Programming Javascript JS ES===== | ===== Programming Javascript JS ES===== | ||
| - | * https:// | + | * https:// |
| * [[https:// | * [[https:// | ||
| Line 22: | Line 26: | ||
| <code javascript> | <code javascript> | ||
| - | // - filter | + | // Filter |
| function query(data) { | function query(data) { | ||
| return _.chain(data) | return _.chain(data) | ||
| .mapValues(value => { | .mapValues(value => { | ||
| if (_.isPlainObject(value)) { | if (_.isPlainObject(value)) { | ||
| - | return filterKeys(value, | + | return filterKeys(value, |
| } | } | ||
| return value; | return value; | ||
| - | }).pickBy( obj => | + | }) |
| - | _.isPlainObject(obj) && Object.keys(obj).length > 0 | + | |
| - | ) | + | |
| .value(); | .value(); | ||
| } | } | ||
| - | function filterKeys(obj, | + | function filterKeys(obj, |
| const result = {}; | const result = {}; | ||
| - | |||
| const filter = (val, key, parent) => { | const filter = (val, key, parent) => { | ||
| - | if(_.isPlainObject(val)) { | + | if (_.isPlainObject(val)) { |
| - | _.forEach(val, | + | _.forEach(val, |
| - | } | + | } |
| - | if(_.includes(key, | + | if (_.some(wildcards, |
| _.set(result, | _.set(result, | ||
| } | } | ||
| }; | }; | ||
| - | |||
| filter(obj, ' | filter(obj, ' | ||
| - | | ||
| return result; | return result; | ||
| } | } | ||
| + | |||
| </ | </ | ||
| ==== Javascript.Chrome ==== | ==== Javascript.Chrome ==== | ||