I have some JSON data that will look something like this:
{
"events": [
{
"event": {
"event_instances": [
{
"event_instance": {
"id": 1365348,
"ranking": 0,
"event_id": 460956,
"start": "2015-07-07T00:00:00-05:00",
"end": null,
"all_day": true
}
}
],
"id": 460956,
"title": "Blue Star Museums",
"url": "http:\/\/www.samhoustonmemorialmuseum.com\/",
"updated_at": "2015-07-07T05:27:49-05:00",
"created_at": "2015-06-02T12:34:01-05:00",
"facebook_id": null,
"first_date": "2015-06-02",
//so on and so forth
I'm need to use that first_date key value in a jQuery conditional that will basically say something like this:
if(first_date.value().substring(0,3) === 2015){
//do something
}
Can you use substrings of key values for conditionals in jQuery?
===you may want to use strings on both sides (i.e.:"2015" === 2015returnsfalse).