<! DOCTYPE html>/*push and pop for stack LIFO lifo,unshift and shift for queue FIFO filo*/ varcolors = ["Red", "Blue", "_", "Yellow"]; //alert (typeof colors.tostring ());//string //alert (typeof colors.valueof ());//object //alert (typeof colors);//object //Alert (colors.join ("|")); //var count = Colors.push ("Black", "green"); //var item = Colors.pop (); varShift =Colors.shift (); varUnshift = Colors.unshift ("AAA", "BBB"); //alert (item); //alert (colors); //alert (shift);//Remove the first red //alert (colors); /*//var values = [1, 2, 3, 4, 5]; Alert (Values.reverse ()); /* There are already two methods available for reordering directly in the array: reverse () and sort (). Reverse () Not very good for*/ functionCompare (value1, value2) {if(Value1 <value2) { return-1; }Else if(Value1 >value2) { return1; }Else{ return0; } } varvalues = [3, 4, 1, 5, 2,-1,-2,-4, 10, 15]; //Values.sort (Compare). reverse (); //alert (values); //alert (Values.reverse ()); //alert (values); */ //var y2k = new Date (DATE.UTC (0)); //var allfives = new Date (DATE.UTC (2005, 4, 5, N, +)); ////var somedate = new Date (Date.parse ("May)"); //alert (Y2K); //alert (allfives); varDate =NewDate (); functionDatedemo () {varDay ; varx = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; //var d = new Date ();Day =Date.getday (); return(X[day]); } functionTimedemo () {varh, M; vart = ["Morning", "Afternoon"]; H=date.gethours (); M= h-12; returnM? T[1]: t[0]; } alert (Date.getfullyear ()+ "-" + (Date.getmonth () + 1) + "-" + date.getdate () + "" + Datedemo () + "" +Timedemo ()+ "" +date.gethours () + ":" + date.getminutes () + ":" +date.getseconds ());functionDatedemo () {varDay ; varx = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; //var d = new Date ();Day =Date.getday (); return(X[day]); }varDate =NewDate (); alert (date.tolocalestring ());//alert (date.tostring ());//alert (date.todatestring ());//alert (date.totimestring ());Alert (date.tolocaledatestring () + Datedemo () +date.tolocaletimestring ()); </script></body>Time Date Type