Skip to content

Instantly share code, notes, and snippets.

@ermauliks
ermauliks / jsbin.tijapit.js
Last active September 22, 2019 06:05
Implementation of Map and Filter Array function in JavaScript
Array.prototype.myMap = function(fn) {
let newArray = [];
this.forEach(item => {
newArray.push(fn(item));
})
return newArray;
}
@ermauliks
ermauliks / jsbin.sotaqim.js
Last active September 22, 2019 18:44
Dynamically create table inside DOM
var mountains = [
{ name: "Monte Falco", height: 1658, place: "Parco Foreste Casentinesi" },
{ name: "Monte Falterona", height: 1654, place: "Parco Foreste Casentinesi" },
{ name: "Poggio Scali", height: 1520, place: "Parco Foreste Casentinesi" },
{ name: "Pratomagno", height: 1592, place: "Parco Foreste Casentinesi" },
{ name: "Monte Amiata", height: 1738, place: "Siena" }
];
String.prototype.firstUpper = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
@ermauliks
ermauliks / index.html
Last active October 19, 2019 22:37
monthly calendar with pure javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
table td {
text-align: center;
}