Here this is the Magento 1 code would like to convert to M2 code.
$customerId = 1;
$orderCollection = Mage::getResourceModel('sales/order_collection')
->addFieldToSelect('*')
->addFieldToFilter('customer_id', $customerId)
->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
->setOrder('created_at', 'desc');
Here mainly need to know how to add ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
statement in Magento2
Thanks
getVisibleOnFrontStates
filter? do you have any idea @AnasMansuri