JSFiddle - React, Tailwind, and code Playground JavaScript var obj = {a:0,b:0}, i=0; for (var k in obj) { i++; delete obj.b; } alert(i) // 1