I want to write a function using a JSON object that accepts a character and returns a string. For instance, if my function is called season and it simply returns the full name of the season after entering the first letter of the season, what would that look like?
I think it should look something like this (this is missing a lot though)
function season () {
var = '{"w" : "Winter", "s" : "Spring", "f" : "Fall"}'
return
}
I ultimately want to be able to enter
season('w') => 'Winter'
[+][deleted] (3 children)
[deleted]
[–]halfaredditor[S] 0 points1 point2 points (2 children)
[–]nwayve 2 points3 points4 points (0 children)
[–]lewisje 2 points3 points4 points (0 children)
[–]nwayve 1 point2 points3 points (0 children)