Skip to content

Instantly share code, notes, and snippets.

@MirzaChilman
Created September 29, 2018 01:02
Show Gist options
  • Save MirzaChilman/5f5b7f4ce8cdb3b5ab069a777c29e418 to your computer and use it in GitHub Desktop.
Save MirzaChilman/5f5b7f4ce8cdb3b5ab069a777c29e418 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/nalapevote
<!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">
let phones= [
{
"name": "iPhone 7",
"brand": "Apple",
"release_year": "2016",
"description": "4.7 in (120 mm), 4.1 in (100 mm) by 2.3 in (58 mm), 16:9 aspect ratio, aluminosilicate glass covered 16,777,216-color (24-bit), IPS LCD screen, 1,334 × 750 px screen resolution at 326 ppi, 1400:1 contrast ratio, 625  cd⁄m² max brightness, LED backlight and fingerprint-resistant oleophobic coatin"
},
{
"name": "iPhone 6s",
"brand": "Apple",
"release_year": "2015",
"description": "4.7 in (120 mm), 4.1 in (100 mm) by 2.3 in (58 mm), 16:9 aspect ratio, aluminosilicate glass covered 16,777,216-color (24-bit), IPS LCD screen, 1,334 × 750 px screen resolution at 326 ppi, 1400:1 contrast ratio, 625  cd⁄m² max brightness, LED backlight and fingerprint-resistant oleophobic coatin"
},
{
"name": "Galaxy S8",
"brand": "Samsung",
"release_year": "2017",
"description": "Samsung announced the Samsung Galaxy S8 and Samsung Galaxy S8+ smartphones on March 29, 2017. It features an iris scanner, which was not present on the Galaxy S7 phones."
},
{
"name": "Galaxy S7",
"brand": "Samsung",
"release_year": "2016",
"description": "Samsung announced the Samsung Galaxy S8 and Samsung Galaxy S8+ smartphones on March 29, 2017. It features an iris scanner, which was not present on the Galaxy S7 phones."
},
{
"name": "Mi 6",
"brand": "Xiaomi",
"release_year": "2017",
"description": "Nothing you can think of this beautiful phone."
},
{
"name": "G6",
"brand": "LG",
"release_year": "2017",
"description": "148.9 x 71.9 x 7.9 mm (5.86 x 2.83 x 0.31 in), 163 g (5.75 oz), Corning Gorilla Glass 5 back panel"
}
]
let data = ['Xiaomi', 'LG']
const filtered =
phones.filter(datum => {
return datum.brand === 'Xiaomi' || datum.brand === 'LG'
})
console.log(filtered)
</script>
<script id="jsbin-source-javascript" type="text/javascript">let phones= [
{
"name": "iPhone 7",
"brand": "Apple",
"release_year": "2016",
"description": "4.7 in (120 mm), 4.1 in (100 mm) by 2.3 in (58 mm), 16:9 aspect ratio, aluminosilicate glass covered 16,777,216-color (24-bit), IPS LCD screen, 1,334 × 750 px screen resolution at 326 ppi, 1400:1 contrast ratio, 625  cd⁄m² max brightness, LED backlight and fingerprint-resistant oleophobic coatin"
},
{
"name": "iPhone 6s",
"brand": "Apple",
"release_year": "2015",
"description": "4.7 in (120 mm), 4.1 in (100 mm) by 2.3 in (58 mm), 16:9 aspect ratio, aluminosilicate glass covered 16,777,216-color (24-bit), IPS LCD screen, 1,334 × 750 px screen resolution at 326 ppi, 1400:1 contrast ratio, 625  cd⁄m² max brightness, LED backlight and fingerprint-resistant oleophobic coatin"
},
{
"name": "Galaxy S8",
"brand": "Samsung",
"release_year": "2017",
"description": "Samsung announced the Samsung Galaxy S8 and Samsung Galaxy S8+ smartphones on March 29, 2017. It features an iris scanner, which was not present on the Galaxy S7 phones."
},
{
"name": "Galaxy S7",
"brand": "Samsung",
"release_year": "2016",
"description": "Samsung announced the Samsung Galaxy S8 and Samsung Galaxy S8+ smartphones on March 29, 2017. It features an iris scanner, which was not present on the Galaxy S7 phones."
},
{
"name": "Mi 6",
"brand": "Xiaomi",
"release_year": "2017",
"description": "Nothing you can think of this beautiful phone."
},
{
"name": "G6",
"brand": "LG",
"release_year": "2017",
"description": "148.9 x 71.9 x 7.9 mm (5.86 x 2.83 x 0.31 in), 163 g (5.75 oz), Corning Gorilla Glass 5 back panel"
}
]
let data = ['Xiaomi', 'LG']
const filtered =
phones.filter(datum => {
return datum.brand === 'Xiaomi' || datum.brand === 'LG'
})
console.log(filtered)
</script></body>
</html>
let phones= [
{
"name": "iPhone 7",
"brand": "Apple",
"release_year": "2016",
"description": "4.7 in (120 mm), 4.1 in (100 mm) by 2.3 in (58 mm), 16:9 aspect ratio, aluminosilicate glass covered 16,777,216-color (24-bit), IPS LCD screen, 1,334 × 750 px screen resolution at 326 ppi, 1400:1 contrast ratio, 625  cd⁄m² max brightness, LED backlight and fingerprint-resistant oleophobic coatin"
},
{
"name": "iPhone 6s",
"brand": "Apple",
"release_year": "2015",
"description": "4.7 in (120 mm), 4.1 in (100 mm) by 2.3 in (58 mm), 16:9 aspect ratio, aluminosilicate glass covered 16,777,216-color (24-bit), IPS LCD screen, 1,334 × 750 px screen resolution at 326 ppi, 1400:1 contrast ratio, 625  cd⁄m² max brightness, LED backlight and fingerprint-resistant oleophobic coatin"
},
{
"name": "Galaxy S8",
"brand": "Samsung",
"release_year": "2017",
"description": "Samsung announced the Samsung Galaxy S8 and Samsung Galaxy S8+ smartphones on March 29, 2017. It features an iris scanner, which was not present on the Galaxy S7 phones."
},
{
"name": "Galaxy S7",
"brand": "Samsung",
"release_year": "2016",
"description": "Samsung announced the Samsung Galaxy S8 and Samsung Galaxy S8+ smartphones on March 29, 2017. It features an iris scanner, which was not present on the Galaxy S7 phones."
},
{
"name": "Mi 6",
"brand": "Xiaomi",
"release_year": "2017",
"description": "Nothing you can think of this beautiful phone."
},
{
"name": "G6",
"brand": "LG",
"release_year": "2017",
"description": "148.9 x 71.9 x 7.9 mm (5.86 x 2.83 x 0.31 in), 163 g (5.75 oz), Corning Gorilla Glass 5 back panel"
}
]
let data = ['Xiaomi', 'LG']
const filtered =
phones.filter(datum => {
return datum.brand === 'Xiaomi' || datum.brand === 'LG'
})
console.log(filtered)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment