What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-03-01 23:35:28
create and use constants in angularjs
// Storing a single constant value var app = angular.module('myApp', []); app.constant('appName', 'My App'); // Now we inject our constant value into a test controller app.controller('TestCtrl', ['appName', function TestCtrl(appName) { console.log(a... Add solution -
Javascript 2022-02-02 21:10:39
chrome extension dynamically add javascript
// content script chrome.runtime.sendMessage({ injectScript : true, filename:'/scripts/myfile.js' }, function(response) { if(response.done) { //handle something when script is done } }); // background script chrome.runtime.onMessage.addLi... Add solution -
Javascript 2022-01-22 21:16:03
expressjs query params
app.get('/path/:name', function(req, res) { // url: /path/test console.log(req.params.name); // result: test }); // OR app.get('/path', function(req, res) { // url: /path?name='test' console.log(req.query['name']); // result: test }); Add solution -
Javascript 2021-11-18 23:38:13
mutable array methods in javascript
/* array literal */ var aData = []; /* object constructur */ function Person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; this.fullname = function() { return (this.firstname + " " + this.lastname); };... Add solution
Best helpers
Ranking is empty