Click here to Skip to main content
15,882,163 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here events is my global variable ..its an array. Event is my object with attributes text and classname (both are string). When I try to access event at date its gives null pointer exception...as in if the object isnt there?? or am I assessing it wrong? please its urgent
<small></small>


C#
events[new Date("04/21/2015")] = new Event("Valentines Day", "pink");
        alert("ev" + events[Date("04/21/2015")].text);
Posted
Comments
Abhinav S 23-Apr-15 4:55am    
Does events contain a string or date type? Is its string, don't convert 04/21/2015 into date.
Member 11578993 23-Apr-15 5:03am    
events is meant to hold objects of type Event...I need to store the Events on certain dates thats is why I am converting date into Date object

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