This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.myMap = function(fn) { | |
let newArray = []; | |
this.forEach(item => { | |
newArray.push(fn(item)); | |
}) | |
return newArray; | |
} |