JSFiddle - React, Tailwind, and code Playground
by Tyler N.
HTML
<div></div>
JavaScript
$(function () {
var attire = {
winter: ['sweater', 'hat', 'boots', 'coat'],
spring: [],
summer: ['swimwear', 'flipflops', 'towel', 'shorts', 'shades'],
fall: []
};
var weather = {
data: ["sunny", "windy", "cold", "cloudy"]
}
var locations = {
data: ["mountains", "beach", "desert"]
};
var currentWeather = weather.data[3];
var currentLocation = locations.data[1];
function yourAttire() {
if (currentWeather && currentLocation) {
return attire.winter[0] +
' , ' +
attire.summer[1] +
' , ' +
attire.summer[3];
}
}
var sentence = 'Youre attire will be '
$('div').append(
"<div>" +
"You're attire will be: " +
yourAttire() +
"</div>"
);
});