Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from anywhere

Simone pimoGit

🏠
Working from anywhere
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@pimoGit
pimoGit / oloo-js-way.js
Last active Dec 9, 2018
One of the less popular way to deal with objects in Javascript that I love
View oloo-js-way.js
var personHelper = {
init: function(name, nick) {
this.name = name;
this.nick = nick;
},
identify: function() {
console.log( "I am " + this.name + " and my nickname is " + this.nick);
}
};
@pimoGit
pimoGit / popular-js-obj-way.js
Created Dec 9, 2018
One of the most popular way to deal with objects in Javascript that I don't like anymore
View popular-js-obj-way.js
@pimoGit
pimoGit / get-obj-ordered-values.js
Last active May 9, 2018
Get jsons values in a determined order with js
View get-obj-ordered-values.js
/*
Since you are iterating to an object’s properties, the order of the properties is not so predictable
(in this case it seems to follow the numeric value of the main property string) so you cannot rely on it.
But, if it’s useful to your goal,
you can sort your result by a property you choose.
In this case, I sort the result by the "score_rank" property to retrieve an array of appidS:
*/
var sections = {