How to check if data is null in data hook and replace with default value

I have a Wix form but not all fields are mandatory so members can leave some of the optional fields blank. I would like to use data hook (beforeInsert) to find out those fields that are not filled up by the members in the form and replace them with a default value.

How can I do that? I cannot get the data to be filled up and saved with the default value if it is not filled up by the member in the form.
export function form1_beforeInsert ( item , context ) {
if ( item.qty === null ){
item.qty = 0;

if ( item.remarks === null ){
item.remarks = “N.A”;

return item;

Please advise.

if (!item.remarks ){
	item.remarks = "N.A";

Thank you so much! It worked like a charm.