Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let choiceObj = {
- doChoice: function(text){
- text = text;
- let choice = prompt(text);
- return this.choice;
- }, // передаю текст в prompt, и возвращаю то что ввел туда пользователь
- choiceUp: function (){
- if (this.choice) {
- console.log('good');
- return true;
- } else {
- console.log("false");
- return false;
- }
- } // Отдельно! возвращаю true или false в зависимости как пользователь отреагировал на prompt.
- }
- choiceObj
- .doChoice("some text here")
- .choiceUp();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement