Pages
HOME
HTML5
CSS3
JAVASCRIPT
PHP
C
SEO/SMM
SOFTWARE
TIPS & TRICKS
PRIVACY POLICY
CONTACTS
Thursday, August 1, 2013
JavaScript arraysort Number_02
<html>
<body>
<script type="text/javascript">
function sortNumber(a, b)
{
return b - a;
}
var n = ["10", "5", "40", "25", "100", "1"];
document.write(n.sort(sortNumber));
</script>
</body>
</html>
Result
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment