code stringlengths 1 2.08M | language stringclasses 1
value |
|---|---|
function bar(a){try{foo()}catch(b){alert("Exception caught (foo not defined)")}alert(a)}bar(10)
| JavaScript |
function f(){var a;return(a="a")?a:a}f() | JavaScript |
function id(a){return a}
| JavaScript |
var a=1,b=2 | JavaScript |
function x(a){return typeof a=="object"?a:a===42?0:a*2}function y(a){return typeof a=="object"?a:null}
| JavaScript |
a=1,b=a,c=1,d=b,e=d,longname=2;if(longname+1){x=3;if(x)var z=7}z=1,y=1,x=1,g+=1,h=g,++i,j=i,i++,j=i+17 | JavaScript |
var a={};a["this"]=1,a.that=2 | JavaScript |
[],Array(1),[1,2,3]
| JavaScript |
var a=8,b=4,c=4 | JavaScript |
result=function(){return 1}() | JavaScript |
(function(){function a(){}(function(){return new a(1,2,3)})()})()
| JavaScript |
(function(){function a(){}return new a(1,2,3,4)})()
| JavaScript |
var a=2e3,b=.002,c=2e-5 | JavaScript |
var a=1;a==1?a=2:a=17 | JavaScript |
with({});
| JavaScript |
function f(){function b(){}if(a)return;b()}
| JavaScript |
var a=function(b){b(),a()} | JavaScript |
var a=13,b=1/3 | JavaScript |
(function(){var a=function(){};return new a(1,2,3,4)})()
| JavaScript |
var a=a+"a"+"b"+1+c,b=a+"c"+"ds"+123+c,c=a+"c"+123+d+"ds"+c | JavaScript |
if(!x)debugger
| JavaScript |
a:break a;console.log(1)
| JavaScript |
o={".5":.5},o={.5:.5},o={.5:.5} | JavaScript |
function a(a){return a==1?2:17} | JavaScript |
function bar(){return--x}function foo(){while(bar());}function mak(){for(;;);}var x=5
| JavaScript |
(function(){var a=function b(a,b,c){return b}})()
| JavaScript |
var a=3250441966 | JavaScript |
((a||b)&&c)()
| JavaScript |
_,_ | JavaScript |
[(a,b)]
| JavaScript |
with({get NaN(){throw 0},get Infinity(){throw 0}})0/0,0/0,1/0,-1/0 | JavaScript |
x=(y,z)
| JavaScript |
var s,i;s="",i=0 | JavaScript |
function test(){debugger;return}
| JavaScript |
var nullString="\0" | JavaScript |
var a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}
| JavaScript |
var a=0;switch(a){case 0:a++} | JavaScript |
typeof a=="string",b+""!=c+"",d<e==f<g | JavaScript |
1
| JavaScript |
(a?b:c)?d:e | JavaScript |
foo.toString();
a.toString(16);
b.toString.call(c);
| JavaScript |
1e20,1e21 | JavaScript |
new (A, B)
new (A || B)
new (X ? A : B) | JavaScript |
print(a / /[a-z]/);
| JavaScript |
var a = {
a: 1,
b: 2, // <-- trailing comma
};
| JavaScript |
function bar(a) {
try {
foo();
} catch(e) {
alert("Exception caught (foo not defined)");
}
alert(a); // 10 in FF, "[object Error]" in IE
}
bar(10);
| JavaScript |
function f() { var a; if (a = 'a') { return a; } else { return a; } }; f(); | JavaScript |
function id(a) {
// Form-Feed
// Vertical Tab
// No-Break Space
// Mongolian Vowel Separator
// En quad
// Em quad
// En space
// Em space
// Three-Per-Em Space
// Four-Per-Em Space
// Six-Per-Em Space
// Figure Space
// Punctuation Space
// Thin Space
// Hair Space
// Na... | JavaScript |
// var declarations after each other should be combined
var a = 1;
var b = 2; | JavaScript |
function x(a) {
if (typeof a === 'object')
return a;
if (a === 42)
return 0;
return a * 2;
}
function y(a) {
if (typeof a === 'object')
return a;
return null;
};
| JavaScript |
a=1;
b=a;
c=1;
d=b;
e=d;
longname=2;
if (longname+1) {
x=3;
if (x) var z = 7;
}
z=1,y=1,x=1
g+=1;
h=g;
++i;
j=i;
i++;
j=i+17; | JavaScript |
var a = {};
a["this"] = 1;
a["that"] = 2; | JavaScript |
(function () {
var cake
if (noFreeCakes) return /* I would
insert something
there, but I'm sort
of lazy so whatever.
*/ cake = new FreeCake()
return cake
})()
(function () {
var cake
if (noFreeCakes) return /* I would... | JavaScript |
a=func();
b=z;
for (a++; i < 10; i++) { alert(i); }
var z=1;
g=2;
for (; i < 10; i++) { alert(i); }
var a = 2;
for (var i = 1; i < 10; i++) { alert(i); }
| JavaScript |
new Array();
new Array(1);
new Array(1, 2, 3);
| JavaScript |
var a = 1 << 3;
var b = 8 >> 1;
var c = 8 >>> 1; | JavaScript |
!function() {
'use strict';
var 七, // issue #222
$1, // issue #222
ლ_ಠ益ಠ_ლ; // issue #324
};
!function() {
'use strict';
// test if Unicode canonical equivalence is ignored
var \u006E\u0303,
\u00F1;
};
!function() {
'use strict';
var \uFF38, // X Lu (third to last)
\uFF58,... | JavaScript |
result=(function(){ return 1;})() | JavaScript |
(function(){
(function(){
return new Array(1, 2, 3);
})();
function Array(){};
})();
| JavaScript |
(function(){
return new Array(1, 2, 3, 4);
function Array() {};
})();
| JavaScript |
var a = 2e3;
var b = 2e-3;
var c = 2e-5; | JavaScript |
var a = 1;
if (a == 1) {
a = 2;
} else {
a = 17;
}
| JavaScript |
with({}) {
};
| JavaScript |
function f() {
if (a) return;
g();
function g(){}
};
| JavaScript |
var a = function(b) {
b();
a()
}
| JavaScript |
// test that the calculation is fold to 13
var a = 1 + 2 * 6;
// test that it isn't replaced with 0.3333 because that is more characters
var b = 1/3; | JavaScript |
(function(){
var Array = function(){};
return new Array(1, 2, 3, 4);
})();
| JavaScript |
var a = a + "a" + "b" + 1 + c;
var b = a + "c" + "ds" + 123 + c;
var c = a + "c" + 123 + d + "ds" + c; | JavaScript |
if (!x) debugger;
| JavaScript |
label1 : {
label2 : {
break label2;
console.log(2);
}
console.log(1);
} | JavaScript |
o = {'.5':.5}
o = {'0.5':.5}
o = {0.5:.5} | JavaScript |
function a(b) {
if (b == 1) {
return 2;
} else {
return 17;
}
return 3;
} | JavaScript |
var x = 5;
function bar() { return --x; }
function foo() { while (bar()); }
function mak() { for(;;); }
| JavaScript |
(function() {
var x = function fun(a, fun, b) {
return fun;
};
}());
| JavaScript |
var a = 0xC1BDCEEE; | JavaScript |
((a || b) && c)();
| JavaScript |
"use strict";
"use strict";
function a() {
void "a";
function b() {
"use strict";
void "b";
function c() {
"use strict";
void "c";
}
function d() {
"salmon";
void "d";
}
}
function e() {
"salmon";
... | JavaScript |
if(_);if(_);else; | JavaScript |
[(a,b)]
| JavaScript |
with({get NaN(){throw 0},get Infinity(){throw 0}})(1/0)/(1/0),0/0,123456/0,-123456/0 | JavaScript |
x = (y, z)
| JavaScript |
var s, i; s = ''; i = 0; | JavaScript |
function test() {
debugger;
return;
}
| JavaScript |
var nullString = "\0" | JavaScript |
var a = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'}; | JavaScript |
var a = 0;
switch(a) {
case 0:
a++;
break;
} | JavaScript |
typeof a === 'string'
b + "" !== c + ""
d < e === f < g
| JavaScript |
{a: 1} | JavaScript |
(a ? b : c) ? d : e | JavaScript |
#! /usr/bin/env node
global.sys = require("sys");
var fs = require("fs");
var jsp = require("../lib/parse-js");
var pro = require("../lib/process");
var filename = process.argv[2];
fs.readFile(filename, "utf8", function(err, text){
try {
var ast = time_it("parse", function(){ return jsp.parse... | JavaScript |
#! /usr/bin/env node
global.DIGITS_OVERRIDE_FOR_TESTING = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
'use strict';
/*jshint bitwise:true, curly:true, eqeqeq:true, forin:true, immed:true,
latedef:true, newcap:true, noarge:true, noempty:true, nonew:true,
onevar:true, plusplus:true, reg... | JavaScript |
#! /usr/bin/env node
global.DIGITS_OVERRIDE_FOR_TESTING = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
var parseJS = require("../lib/parse-js");
var sys = require("util");
// write debug in a very straightforward manner
var debug = function(){
sys.log(Array.prototype.slice.call(argument... | JavaScript |
#! /usr/bin/env node
global.DIGITS_OVERRIDE_FOR_TESTING = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
var parseJS = require("../lib/parse-js");
var sys = require("util");
// write debug in a very straightforward manner
var debug = function(){
sys.log(Array.prototype.slice.call(argument... | JavaScript |
if (typeof jQuery !== 'undefined') {
(function($) {
$('#spinner').ajaxStart(function() {
$(this).fadeIn();
}).ajaxStop(function() {
$(this).fadeOut();
});
})(jQuery);
}
| JavaScript |
$(function() {
$('#side-menu').metisMenu();
});
//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
$(function() {
$(window).bind("load resize", function() {
console.log($(this).width())
if ($(this).width() < 768) {
$('div.sidebar-coll... | JavaScript |
;(function ($, window, document, undefined) {
var pluginName = "metisMenu",
defaults = {
toggle: true
};
function Plugin(element, options) {
this.element = element;
this.settings = $.extend({}, defaults, options);
this._defaults = defaults;
t... | JavaScript |
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Licensed under the MIT license.
It works by listening for changes on the placeholder div (through the jQuery
resize event plugin) - if the size changes, it will redraw the plot.
There ar... | JavaScript |
/*
Flot plugin for rendering pie charts. The plugin assumes the data is
coming is as a single data value for each series, and each of those
values is a positive value or zero (negative numbers don't make
any sense and will cause strange effects). The data values do
NOT need to be passed in as percentage values... | JavaScript |
/*! Javascript plotting library for jQuery, v. 0.7.
*
* Released under the MIT license by IOLA, December 2007.
*
*/
// first an inline dependency, jquery.colorhelpers.js, we inline it here
// for convenience
/* Plugin for jQuery for working with colors.
*
* Version 1.1.
*
* Inspiration from jQu... | JavaScript |
/* Set the defaults for DataTables initialisation */
$.extend(true, $.fn.dataTable.defaults, {
"sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>" + "t" + "<'row'<'col-sm-6'i><'col-sm-6'p>>",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
}
});
/* Default class modification */
$.extend... | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.