Object.prototype.rain = "雨です"; Object.prototype.sunny = "晴れです"; Object.prototype.cloudy = "曇りです"; today_weather = new Object(); num = prompt("何か数字入れて"); if(num == 1){ alert(today_weather.rain); }else if(num == 2){ alert(today_weather.sunny); }else if(num ==3){ alert(today_weather.cloudy); }else{ new_weather = prompt("新しい天気は?"); Object.prototype.another = new_weather; alert(today_weather.another); }