-
What is the "smallest" number possible in JavaScript?
-
Explain why the following doesn't work as an IIFE. What needs to be changed to properly make it an IIFE?
function foo(){ }();
-
What is
arr.length
?
var arr = [];
arr[10] = 'ten';
# .bash_logout | |
# Executed after logout of bash shells | |
clear |
What is the "smallest" number possible in JavaScript?
Explain why the following doesn't work as an IIFE. What needs to be changed to properly make it an IIFE?
function foo(){ }();
What is arr.length
?
var arr = [];
arr[10] = 'ten';
syntax on " turns syntax highlighting on | |
colorscheme default " defines the color scheme of the syntax highlighting | |
set nocompatible " (cp) use Vim defaults (much better) | |
set hidden " (hid) hide buffers instead of closing them when they are abandoned | |
set ruler " (ru) show the cursor position at all times | |
set showcmd " (sc) display an incomplete command in the lower right | |
set history=100 " (hi) keep 50 lines of command history | |
set undolevels=100 " (ul) maximum number of changes that can be undone | |
set number " (nu) show line numbers |
.vendorify(@prop, @vals...) { | |
@property: e('@{prop}'); | |
@values: `'@{arguments}'.replace(/^\[|\]$/g, '').split(', ').splice(1)`; | |
// v1.6.0 added interpolation allowing us to do this: | |
-o-@{property}: @values; | |
-ms-@{property}: @values; | |
-moz-@{property}: @values; | |
-webkit-@{property}: @values; | |
@{property}: @values; |
### General settings | |
##################################### | |
DirectoryIndex index.inc | |
Options +FollowSymlinks | |
Options -Indexes | |
### Enable GZIP compression | |
##################################### |
/** | |
* Variable substitution on a string. | |
* | |
* Scans through a string looking for expressions enclosed within double curly braces. | |
* If an expression is found, use it as a key on the object, | |
* and if the key has a string or number value, | |
* it is substituted for the bracket expression and it repeats. | |
* | |
* Originally by Douglas Crockford: http://javascript.crockford.com/remedial.html | |
*/ |
/** | |
* Validates a Sudoku game. | |
* The input <vals> is assumed to be an array of arrays with numerical values from 1 through 9. | |
*/ | |
function validoku(vals) { | |
var val, | |
x, y, blockX, | |
uniqRow = {}, | |
uniqCols = [{}, {}, {}, {}, {}, {}, {}, {}, {}], // this construct could be "built up" on each loop iteration, but it's done this way for clarity of example | |
uniqBlocks = [{}, {}, {}]; |
// growing (alternating characters) line | |
c=0;b="";setInterval("console.log(b=b+(c++%2?'-':'|'))",100) | |
// same, but w/o setInterval() ∴ w/o eval() | |
c=0;b="";(function f(){console.log(b=b+(c++%2?'-':'|'));setTimeout(f,100)}()) | |
// wave | |
i=j=0;s="";setInterval("if(!(i++%25))++j;console.log(j%2?s+='*':s=s.substr(1))",15) | |
// same, but w/o setInterval() ∴ w/o eval() |
.hide-text { | |
display: block; | |
white-space: nowrap; | |
text-indent: 100%; | |
overflow: hidden; | |
} | |
.hide { | |
position: absolute; | |
clip: rect(1px, 1px, 1px, 1px); |