Skip to content

Instantly share code, notes, and snippets.

@sarkistlt
sarkistlt / Sample.html
Created April 1, 2016 20:57
DIRECTV_test-task
<!doctype html>
<html>
<head>
<script src="sample.js"></script>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<div id="mainDiv">
<div id="innerDiv" style="padding: 10px">
<div class="leftDiv">
@sarkistlt
sarkistlt / is-anagram.js
Last active March 31, 2016 21:19
String comparison to the number of matching symbols.
let isAnagram = (str1, str2) => {
if (str1.length !== str2.length) return console.log('false');
let obj1 = {},
obj2 = {},
equal = str1.length;
for (let i = 0; i < str1.length; i++) {
(obj1[str1.charAt(i)]) ? obj1[str1.charAt(i)] += 1 : obj1[str1.charAt(i)] = 1;
(obj2[str2.charAt(i)]) ? obj2[str2.charAt(i)] += 1 : obj2[str2.charAt(i)] = 1;