Skip to content

Instantly share code, notes, and snippets.

View gowthm's full-sized avatar
:octocat:
Fly High

Gowtham gowthm

:octocat:
Fly High
View GitHub Profile
let a ={}
let b = {key: 'b'}
let c = {key: 'c'}
a[b] = 78
a[c] = 34
console.log(a[b])
---------------------------------------------------------------------------------------------------------------------------------------
@gowthm
gowthm / countByEachString.js
Last active September 21, 2022 14:31
Javascript Programs.
let s = 'aaabbcddddswwaaaaa';
let c = 1;
let data = []
for (let i=0; i<s.length; i++) {
if (s[i] != s[i+1]) {
data.push(c);
data.push(s[i]);
c = 1;
} else {
c = c + 1;