HOWPROGRAMMINGWORKS Telegram 1823
Кто узнает в этом коде плохие практики?
Если не узнаете, и вам все ок, то смотрите в репозиторий, там список и как исправить https://github.com/HowProgrammingWorks/GoodParts/blob/main/JavaScript/1-func-bad.js
const getPrice = function(options = { convert: true }) {
let price;
let item = { price } = this;
if (!Array.isArray(item)) {
let { price } = this;
if (typeof price == 'number') return price;
price = this.cost;
if (typeof price == 'number') return price;
if (options.convert) return parseFloat(price);
}
[, price] = this;
if (typeof price == 'number') return price;
if (options.convert) price = +price;
if (!isNaN(price)) return price;
};



tgoop.com/HowProgrammingWorks/1823
Create:
Last Update:

Кто узнает в этом коде плохие практики?
Если не узнаете, и вам все ок, то смотрите в репозиторий, там список и как исправить https://github.com/HowProgrammingWorks/GoodParts/blob/main/JavaScript/1-func-bad.js

const getPrice = function(options = { convert: true }) {
let price;
let item = { price } = this;
if (!Array.isArray(item)) {
let { price } = this;
if (typeof price == 'number') return price;
price = this.cost;
if (typeof price == 'number') return price;
if (options.convert) return parseFloat(price);
}
[, price] = this;
if (typeof price == 'number') return price;
if (options.convert) price = +price;
if (!isNaN(price)) return price;
};

BY HowProgrammingWorks - JavaScript and Node.js Programming


Share with your friend now:
tgoop.com/HowProgrammingWorks/1823

View MORE
Open in Telegram


Telegram News

Date: |

Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. The best encrypted messaging apps How to Create a Private or Public Channel on Telegram? Other crimes that the SUCK Channel incited under Ng’s watch included using corrosive chemicals to make explosives and causing grievous bodily harm with intent. The court also found Ng responsible for calling on people to assist protesters who clashed violently with police at several universities in November 2019. Ng, who had pleaded not guilty to all charges, had been detained for more than 20 months. His channel was said to have contained around 120 messages and photos that incited others to vandalise pro-government shops and commit criminal damage targeting police stations.
from us


Telegram HowProgrammingWorks - JavaScript and Node.js Programming
FROM American