Skip to content

Instantly share code, notes, and snippets.

View LearningMaterial's full-sized avatar

Ashiqur Rahman LearningMaterial

View GitHub Profile
var JS = {
name: "The Javascript language",
log() {
this.name = "updated Javascript Language";
console.log(this);
var setName = newName => {
// this points to JS object
this.name = newName;
};
var JS = {
name: "The Javascript languaget",
log: function() {
this.name = "updated Javascript Language";
console.log(this);
var setName = function(newName) {
// this points to global object
this.name = newName;
};
var profile = {
firstName: "Tamim",
lastName: "Iqbal",
fullName() {
return `${this.firstName} ${this.lastName}`;
}
};
console.log(profile.fullName());
var profile = {
firstName: "Tamim",
lastName: "Iqbal",
fullName: () => {
return `${this.firstName} ${this.lastName}`;
}
};
console.log(profile.fullName());
const footballLeagues = [
{ type: "english_premier_league", total_goal: 341, target: "English-player" },
{ type: "english_premier", total_goal: 341, target: "English-player" },
{ type: "bundesliga", total_goal: 341, target: "German-player" },
{ type: "english_premier_league", total_goal: 341, target: "English-player" },
{ type: "la_liga", total_goal: 411, target: "Spanish_player" },
{ type: "la_liga", total_goal: 101, target: "Argentain_player" }
];
const la_ligaDetail = footballLeagues
const footballLeagues = [
{ type: "english_premier_league", total_goal: 341, target: "English-player" },
{ type: "english_premier", total_goal: 341, target: "English-player" },
{ type: "bundesliga", total_goal: 341, target: "German-player" },
{ type: "english_premier_league", total_goal: 341, target: "English-player" },
{ type: "la_liga", total_goal: 411, target: "Spanish_player" },
{ type: "la_liga", total_goal: 101, target: "Argentain_player" }
];
const la_ligaDetail = footballLeagues
const ages = [19, 4, 32, 18, 17, 12, 9, 14, 15];
const old = ages.filter(age => age >= 18);
console.log(old);
const ages = [19, 4, 32, 18, 17, 12, 9, 14, 15];
const old = ages.filter(age => {
return age >= 18;
});
console.log(old);
const names = ["sakib", "tamim", "Riad"];
const fullNames = names.map(name => {
return `${name}`;
});
console.log(fullNames);
const names = ["sakib", "tamim", "Riad"];
const fullNames = names.map(function(name) {
return `${name}`;
});
console.log(fullNames);