It was another tumultuous week in the stock market, highlighted by AI jitters, but prices ended on a strong note on Friday.