/[a-z]/
// Demo: https://jsfiddle.net/ajgp31ra/2/ | |
// Note: No pseudo elements (:before / :after) | |
.grid-3x3 { | |
display: inline-block; | |
box-sizing: content-box; | |
margin: 8px; | |
width: 4px; | |
height: 4px; |
var testCount = 10000; | |
var arr = ['a', 'b', 'c']; | |
var str = ''; | |
var prevDate = new Date().getTime(); | |
for (var i = 0; i < testCount; i += 1) { | |
str = ''; | |
for (var t = 0; t < arr.length; t += 1) { | |
str += arr[t]; | |
if (t < arr.length - 1) { |
var canvas = document.getElementById('canvas'); | |
var ctx = canvas.getContext('2d'); | |
function plotStar (x, y, r, s) { | |
var offset = Math.PI * 2 / (s * 2); | |
var cross = Math.cos(offset * 2) * r; | |
var r2 = cross / Math.cos(offset); | |
for (var i = 0; i < s * 2 + 1; i += 1) { |
I have the following variables: type
, collection
And the utility function: ReactTableUtilities.hasOnlyZeroValues
I must return null
, if type
is any of the following: 'ACCOUNT'
, 'GROUP'
, 'FORMULA'
, and (inclusive) if all of the values in this collection
are zero values.
How would you write this conditional return?
Leave a comment with your code and reasoning.
/* | |
Once inspired by: https://github.com/scalableminds/fluent-canvas#tapcallback | |
*/ | |
// All methods are bound to the canvasimo object | |
canvasimo | |
.tap(function () { |
So, the way I see it, is we have 2 options for chain indentation
Indented, and not indented
There are 3 examples of each below
Bare in mind, that you can still chain inline (unless we enforce newlines for multi-chains) http://eslint.org/docs/rules/newline-per-chained-call
And that the linter does not lint for variable declarations: "Any indentation is permitted in variable declarations and assignments."
canvas { | |
background-color: white; | |
} |
// https://jsfiddle.net/7Ldmmrjd/1/ | |
span { | |
display: inline-block; | |
width: 12px; | |
height: 12px; | |
} | |
span, | |
span::before, |