Browse Source

exercise 3

master
Bram Dieudonne 2 years ago
parent
commit
33668d5be1
2 changed files with 14 additions and 0 deletions
  1. 8
    0
      exercise_3.js
  2. 6
    0
      test.js

+ 8
- 0
exercise_3.js View File

@@ -0,0 +1,8 @@
let num = 1601;

if (String(num).includes('.')) {
console.log(String(num).length - 1);
}
else {
console.log(String(num).length);
}

+ 6
- 0
test.js View File

@@ -0,0 +1,6 @@
/* let array = [1, 'javascript', true, null, [1, 2, 3], { value: 'javascript' }, function () { console.log('this is inception') }];
array[array.length - 1]();

console.log(array[array.length - 1]); */



Loading…
Cancel
Save