js_task_answers's Issues
typeof(null)
if ( typeof(a) === 'string' && typeof(a) != null && typeof(b) != null
typeof(null)
- возвращает "object". "object" не может сравниваться с null;
let answer = null;
if(answer == null) {
break;
}
// typeof(answer) == null
- не будет работать, потому что сравниваться будет "object" == null
В последующих задачах/файлах такой же код.
Если будет задача что-то сделать при "Cancel - null" от пользователя, то такое сравнение никогда не сработает
detectLevel() dont check boundary values
function detectLevel() { // Расчет уровня достатка
if (appData.moneyPerDay < 100) {
console.log ("Это минимальный уровень достатка!");
} else if (appData.moneyPerDay > 100 && appData.moneyPerDay < 2000) { /
console.log ("Это средний уровень достатка!");
} else if (appData.moneyPerDay > 2000) {
console.log ("Это высокий уровень достатка!");
} else {
console.log ("Ошибочка...!");
}
}
detectLevel();
//не учтены значения 100 и 2000 - код идет по ветке else
Вопрос к четвёртой практической части
JS_task_answers/JS_step_4/script.js
Line 60 in bec35a5
Мы создаём метод toggleVisibleMyDB, котоорый проверяет приватность нашей датабазы и меняет его на обратный. А для чего его проверять? Нельзя ли просто в методе сделать так, чтобы при его вызове приватность менялась на обратную?
Например: personalMovieDB.privat = !personalMovieDB.privat;
Спасибо за ответ.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.