I'm stumped as to why my for loops are displaying "undefined" before any of my actual output occurs. I have all variables declared, and using Inspect Element shows no syntax errors.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Untitled Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function(){
"use strict";
var html, s, vindex;
var v = ['alpha::one::uno', 'beta::two::dos', 'gamma::three::tres'];
for (vindex = 0; vindex < v.length; vindex++) {
s = v[vindex].split('::');
html += '<div class="inline ' + s[0] + '">\n';
html += '<h4>' + s[1] + '</h4>';
html += '<a href="javascript://" class="link">' + s[2] + '</a></div>';
}
$("div").append( html );
});
</script>
</head>
<body>
<div></div>
</body>
</html>