Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
1 iter vs 3 iter
(version: 0)
Comparing performance of:
1 vs 3
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
yourFlatObject = { "height": "172", "mass": "77", "hair_color": "blond", "skin_color": "fair", "eye_color": "blue", "birth_year": "19BBY", "gender": "male", "created": "2021-11-07T15:18:53.215Z", "edited": "2021-11-07T15:18:53.215Z", "name": "Luke Skywalker", "homeworld": "https://www.swapi.tech/api/planets/1", "url": "https://www.swapi.tech/api/people/1", "2height2": "172", "2mass": "77", "2hair_color": "blond", "2skin_color": "fair", "2eye_color": "blue", "2birth_year": "19BBY", "2gender": "male", "2created": "2021-11-07T15:18:53.215Z", "2edited": "2021-11-07T15:18:53.215Z", "2name": "Luke Skywalker", "2homeworld": "https://www.swapi.tech/api/planets/1", "2url": "https://www.swapi.tech/api/people/1" }
Tests:
1
let html = ''; for ( let item in yourFlatObject ) if (yourFlatObject[item] ) //!= null html+=`<p>${yourFlatObject[item]}</p>`; html = html?`<div class="info">${html}</div>`:'';
3
let html = ''; const filteredData = Object.entries(yourFlatObject) .map(([key, value]) => ({ key, value })) .filter(({ value }) => value != null); if ( filteredData.length ) { for ( let item in filteredData ) html+=`<p>${filteredData[item]}</p>`; html = `<div class="info">${html}</div>`; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
3
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
lodash vs native Clone
Lodash cloneDeep vs JSON Clone
Lodash cloneDeep vs JSON Clone (Large Object 2)
JSON Querying Comparisons
JSON Querying Comparisons + JmesPath
Comments
Confirm delete:
Do you really want to delete benchmark?