JSFiddle - React, Tailwind, and code Playground

by You Chuan Hao

JavaScript

data = {
highscore: 0,
localStorage: null,
footsteps: 0,
start: 0,
checkin: 0,
health: 6,
fed: 0,
birthday: Date.now(),
feedCount: 0,
pet_push_time: 0,
old_pet_mod: false, old_pet_birthday: Date.now(),
old_pet_days: -1,
old_pet_pet_push_time: 0,
old_pet_feedCount: 0,
back_HPbox: 0,
}
function undefined_test(val) {
if (val === undefined){
return 1
} else { return 0
} //1表示這個值未定義
}
alert(undefined_test(data.test));