MarcinKrol

Zad 16 - JS

Nov 24th, 2020
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. const unit = prompt('Podaj liczbę(bez pierwisatków): ') * 1;
  2.  
  3. let result = (numb) => {
  4. if (numb >= 0){
  5. document.write(`Wartość bezwzględna z ${numb} to: ${numb}`);
  6. }
  7. else{
  8. document.write(`Wartość bezwzględna z ${numb} to: ${numb = -numb}`);
  9. }
  10. }
  11. result(unit);
Add Comment
Please, Sign In to add comment