JSFiddle - React, Tailwind, and code Playground

by Ting-Yuan Chang

JavaScript

// noprotect

var json=[{"name":"Lenovo Thinkpad 41A4298","website":"google"},
{"name":"Lenovo Thinkpad 41A2222","website":"google"},
{"name":"Lenovo Thinkpad 41Awww33","website":"yahoo"},
{"name":"Lenovo Thinkpad 41A424448","website":"google"},
{"name":"Lenovo Thinkpad 41A429rr8","website":"ebay"},
{"name":"Lenovo Thinkpad 41A429ff8","website":"ebay"},
{"name":"Lenovo Thinkpad 41A429ss8","website":"rediff"},
{"name":"Lenovo Thinkpad 41A429sg8","website":"yahoo1"}];


 var as=$(json).filter(function (i,n){return n.website.search(/yahoo/i)>=0;});



for (var i=0;i<as.length;i++)
  {
    alert(as[i].name +"         "+as[i].website);
}