Category: JavaScript

Pass Command Line Arguments to npm

If you want to pass command line arguments to `npm` scripts, use the `–` separator.

Metadata/Frontmatter of current note in Obsidian

Get the metadata or the frontmatter of the currently open note in Obsidian plugin development.

Get selected text in Obsidian

Getting the currently selected text when creating an Obsidian plugin

Get current file content in Obsidian

Get currently open file and content when developing a plugin for Obsidian

Puppeteer and ShadowDOM

If you are testing an app – be it React, Angular or Vue – and you are using an library…

Object Or Array Check in JavaScirpt

Test whether an object is an object or an array if(Object.prototype.toString.apply(arr) === ‘[object Array]’) alert(“Array”) Original Article

Change shell

Change shell command chsh

Finding the Factorial using Recursion

Finding the Factorial using Recursion in javascript. function factorial(x) { if(x

A Simple Logging Function for JavaScript

Prints all the arguments of the function. This function uses console.log if firebug is available – else, uses alert. function…

Chainable interface in JavaScript

Creating Chainable interfaces in javascript… (function() { function _init() { return this; } _init.prototype = { “myFunction”: function() { return…