Let's say both loans require only one payment per year, and you will pay off the loan at that time. Let's say your 401k earns 8% per year.
Status quo: After one year, your $10K debt becomes $11K, which you pay off. Meanwhile, the $10K in your 401k becomes $10.8K.
Alternative: You pull out $10K today and pay off the debt; but now you owe $10K to your 401k. After one year, you pay $10.6K to your 401k.
By taking the 401k loan, your payment will be $400 lower, but your 401k will end up with $200 less in it. You are $200 ahead, sort of -- the extra money is in your pocket, not in the tax-advantaged 401k.
Put another way, you gain the 10% interest savings from not having the loan, and you lose what your 401k would earn. The 6% is not so important, as it's paid to yourself. It's not possible to give a precise value, since it's not possible to predict what the 401k would earn over that time period.
However, the principal issue here is not the savings (which are unknown, but probably positive), but with the risk and other ancillary issues. 401k repayments are often structured by automatic paycheck withdrawal, lowering your flexibility. If you lose your job, or change jobs, and stop making payments, then very bad things happen. Your loan becomes an early withdrawal, which will be subject to taxes, penalties, and interest. This will wipe out your gains many times over.