Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have one array of objects ok, now i want all object that is greater than 2016-09-13 and less than 2019-09-13

here is my code
var array = 
[ {
	"id" : 1,
	"name": "akshay",
	"Salary": 15000,
	"dob":"1991-08-21",
	"hired date":"2016-09-11"	
 },
 {
	"id" : 2,
	"name": "jyoti",
	"Salary": 25000,
	"dob":"1996-10-13",
	"hired date":"2017-09-11"	
 
 },
 {
	"id" : 3,
	"name": "rajesh",
	"Salary": 35000,
	"dob":"1994-08-12",
	"hired date":"2017-12-11"	
 
 },
 {
	"id" : 4,
	"name": "tijo",
	"Salary": 75000,
	"dob":"1998-08-21",
	"hired date":"2018-05-11"	
 },
 {
	"id" : 5,
	"name": "shankar",
	"Salary": 65000,
	"dob":"1995-08-21",
	"hired date":"2018-09-15"	
 }
] 


in above case i want result array of id 2,3 4
so how would i do using any array function in angular 7 ??

What I have tried:

i tried to search and try various method, but i couldn't succeed
Posted
Updated 17-Oct-19 18:29pm
v2
Comments
Richard Deeming 17-Oct-19 14:17pm    
Array.prototype.filter() - JavaScript | MDN[^]

But that's not valid JSON. There isn't a way to represent a date literal in JSON; you'd need to wrap the date values in quotes.
Akshay malvankar 18-Oct-19 0:35am    
ty bro its worked
Akshay malvankar 18-Oct-19 0:27am    
ok got it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900