Object.keys()应用
<script type="text/javascript">
var person={
firstName:"David",
lastName:"Walsh",
others:"Smith"
};
Object.keys(person).forEach(function(trait){
console.log('person',trait,':',person[trait]);
});
</script>

浙公网安备 33010602011771号