sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| createDiagram(7, 3) return should be: | |
| '* ' | |
| ' * ' | |
| ' *' | |
| ' *' | |
| ' * ' | |
| '* ' | |
| ' * ' | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyArrayConstructor { | |
| constructor() { | |
| this.length = 0; | |
| } | |
| push(value) { | |
| this[this.length] = value; | |
| this.length += 1; | |
| return this.length; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * get function arguments as array | |
| * @param {Function} fn | |
| * @returns {String[]} arguments as array | |
| */ | |
| function getFunctionArgs(fn) { | |
| if (typeof fn !== 'function') throw new Error('fn must be a function'); | |
| if (fn.length === 0) return []; | |
| const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // usage like this: <div class="mt20">Content</div> to give you margin-top: 10px | |
| .make-margins(@size: 50, @decrement: 5) when (@size >= 0) { | |
| .make-margins(@size - @decrement); | |
| @size-px: ~'@{size}px'; | |
| .m@{size} { | |
| margin: @size-px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* değiştirilebilir ve yalnızca bir defa tanımlanabilir bir ifade */ | |
| let number = 10; | |
| console.log(number); // Çıktı: 10 | |
| number = 20; | |
| console.log(number); // Çıktı: 20 | |
| let number = 30; // Hata, Uncaught SyntaxError: Unexpected number | |
| /* block scope'tur bulunduğu yerden ulaşılabilirdir sadece */ | |
| let foo='outside'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const number = 10; | |
| console.log(number); // Çıktı: 10 | |
| const number = 20; // Identifier 'number' has already been declared | |
| // gördüğünüz üzere değeri değiştirmek istediğimiz hata aldık | |
| const fruit = "banana"; | |
| console.log(fruit); // Çıktı: banana | |
| furit = apple; // Uncaught ReferenceError: apple is not defined | |
| // gördüğünüz üzere değeri değiştirmek istediğimizde yine hata aldık |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // var kullanırken değişkenleri tekrar tekrar tanımlayabiliriz. | |
| var number = 10; | |
| var number = 20; | |
| var number = 0; | |
| number = 5; | |
| var number = 18; | |
| console.log(number); // Çıktı: 18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function var02() { | |
| var x = 1; | |
| function bar() { | |
| var y = 2; | |
| console.log(x); // 1 ("x" bar fonksiyonunu kapsar) | |
| console.log(y); // 2 ("y" function scope) | |
| } | |
| bar(); | |
| console.log(x); // Çıktı: 1 | |
| console.log(y); // Çıktı: Uncaught ReferenceError: y is not defined, "y" sadece bar içinde çalışır |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x = 1; | |
| if (x === 1) { | |
| var x = 2; | |
| var y = 8 | |
| console.log(x); | |
| // Çıktı: 2 | |
| } |
NewerOlder