Explain a bug
Understand why JavaScript joins strings instead of adding numbers.
DeepSeek · IN MOST AI
DeepSeek Explore the problem. Understand the solution.Check reasoning, understand code and organise information. Ask for the cause of an error and a concrete example of the fix.
Select DeepSeek in the model list
Understand why JavaScript joins strings instead of adding numbers.
Add validation so the value “нет цены” produces a clear error.
Check normal input, an empty array and invalid values.
START WITH YOUR OWN TASK
Start with a complete request, then refine the result with a follow-up. Adapt the facts to your task.
Find and fix the JavaScript error: function total(prices) { return prices.reduce((sum, price) => sum + price, 0); } const prices = ["120", "80", "50"]; The result should be the number 250. Explain the cause, show corrected code and one check. Up to 100 words.
Add validation: the value "нет цены" must throw a clear error. Show only the changed function and one call, up to 90 words.
For total(prices), which uses Number(price) and Number.isFinite validation, write three tests: ["120", "80", "50"] returns 250; an empty array returns 0; ["нет цены"] throws a clear error. Show the input, expected result and a short explanation.
Open the chat and select the exact model name shown on the card.
The Pro version for text and code. Compare it with Flash on the same snippet: look for a correct fix and a clear explanation.
Choose in chatThe recordings show the Russian-language studio with English step captions.

Open the model menu, search by name and select the version you need.

Describe the task, add the facts and specify the format of the answer.

Read the answer, ask a follow-up question if needed and copy the result.
Yes. Continue in the same conversation, refer to the previous answer and explain what to change: the tone, length, reasoning or format.
Paste the relevant text, data or code into your message and explain what you need from it. Avoid including passwords or unnecessary personal information.
The rate depends on the selected model and the amount of input and output text. Check the current terms in the catalogue before sending a request.
Most AI lists V4 Pro and V4.1 Flash.