Skip to content

Instantly share code, notes, and snippets.

View pimoGit's full-sized avatar
🏠
Working from anywhere

Simone pimoGit

🏠
Working from anywhere
View GitHub Profile
<!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 / popular-js-obj-way.js
Created December 9, 2018 17:16
One of the most popular way to deal with objects in Javascript that I don't like anymore
@pimoGit
pimoGit / oloo-js-way.js
Last active December 9, 2018 18:28
One of the less popular way to deal with objects in Javascript that I love
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 / get-obj-ordered-values.js
Last active May 9, 2018 13:02
Get jsons values in a determined order with 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 = {