el = find('.NewTaxReturn-section-list-item-wrap:nth-child(2) a')
expect( el[:class].include?("m-disabled") ).to eq true
visit('/projects')
visit(post_comments_path(post))
click_link('id-of-link')
N.howMuch.dollarize = function(num){ | |
var l = num.toString().length; | |
var dollarized; | |
if ( l >= 1 && l <= 3 ){ | |
dollarized = num; | |
} | |
else if ( l >= 4 && l <= 6 ){ | |
dollarized = num.toString().substring(0, l-3) + 'K'; | |
} | |
else if (l > 6 ){ |
get 'industry-select', to: 'eligibilities#industry_select' | |
get 'industry-detail', to: 'eligibilities#industry_detail' | |
get 'business', to: 'eligibilities#business' | |
get 'finances', to: 'eligibilities#finances' |
function sortArgs () { | |
// Convert arguments object into a real array | |
var args = [].slice.call(arguments); | |
// Now this will work! | |
sorted = args.sort() | |
return sorted; | |
} |
function myFunc(paramObject) { | |
var defaultParams = { | |
param1: "first string", | |
param2: "second string", | |
param3: "third string" | |
}; | |
var finalParams = _.extend(defaultParams, paramObject); | |
console.log(finalParams.param1, |
var original = "There is 1 number."; | |
var updated = Array.prototype.filter.call(original, function(val) { | |
return val.match(/1/); | |
}); | |
// Outputs: ["1"] | |
console.log(updated); | |
// Outputs: "1" |
console.time("factorial test"); | |
for (var i = 1; i < 100000; i++) { | |
factorial(20); | |
} | |
console.timeEnd("factorial test"); |
//deep copy | |
var deepCopy = jQuery.extend(true, {}, arr); | |
//deep copy an array of objects | |
var originalArr = JSON.parse(JSON.stringify(this.state.labels)) //deep copy |
var $logger = $('<div class="logger">').css({'background-color': 'white',position: 'fixed', display: 'inline-block', 'z-index': 99999}) | |
$('body').prepend( $logger ); | |
function log(val){ $logger.html(val) } |
var curriedAdd = function(a) { | |
return function(b) { | |
return a + b; | |
}; | |
}; | |
var addTen = curriedAdd(10) | |
console.log(addTen(5)) <= 15 |