I often saw in operator in some library of Javascript.
but I think in operator has risk of causing human errors.
because we have to write property name as string type.
I think optional chaining could be alternative of in operator and It looks more safe.
we can get help of intelligence of IDE during writing code.
what is the benefit of using in keywords instead of Optional Chaining?

AFAIK,
inis used to get to know whether the property exists in an object or its prototype or not.and if you are using optional chaining then you are checking the value to be truthy or not
But think of a situation where the value of that property is a
falsyvalue then theinoperator will give you the result of property existence. If the value is a falsy value then you have to make additional checks to know whether the property exists or not.