sana,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<script>
var movies=new Array("Star Wars: Episode VII - The Force Awakens","Max","Spirited Away","The Hunger Games","Wild");
for(var i=0;i < movies.length;i++)
function listMovies(movies)
{
var result=movies.sort();
return result;
}
document.writeln("<br>Фильмы в алфавитном порядке:<br>");
document.writeln(movies.sort().join('<br>'));
document.writeln("<br>Фильмы в обратном порядке:<br>");
document.writeln(movies.reverse().join('<br>'))
</script>
</body>
</html>