Console
How do I make an console?
What is a console? How do you make a console? This script and codes were developed by Renaud Tertrais on 12 August 2022, Friday.
Console - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>console</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/codemirror.min.css'>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.23.0/theme/dracula.min.css'>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
Console - Script Codes JS Codes
'use strict';
var coma = function coma(arr, i) { return i < arr.length - 1 ? ', ' : '';
};
var compose = function compose(f, g) { return function () { return f(g.apply(undefined, arguments)); };
};
var typeOf = function typeOf(x) { return Object.prototype.toString.call(x).slice(8, -1);
};
var is = function is(type, x) { return typeOf(x) === type;
};
var entries = function entries(obj) { var res = []; for (var key in obj) { res.push([key, obj[key]]); }return res;
};
var formatResult = function formatResult(result) { if (result === undefined) return '<div class="cm-atom">undefined</div>'; if (result === null) return '<span class="cm-atom">null</span>'; if (result === null) return '<span class="cm-atom">null</span>'; if (is('Boolean', result)) return '<span class="cm-atom">' + (result ? 'true' : 'false') + '</span>'; if (is('Number', result)) { return '<span class="cm-number">' + (isNaN(result) ? 'NaN' : result) + '</span>'; } if (is('String', result)) return '<span class="cm-string">"' + result + '"</span>'; if (is('Function', result)) return '<span><em><span class="cm-keyword">function</span> <span class="cm-def">' + (result.name || 'anonymous') + '</span></em></span>'; if (is('Array', result)) return '<span>[' + result.map(function (v, i, arr) { return '<span>' + formatResult(v) + coma(arr, i) + '</span>'; }).join('') + ']</span>'; if (is('Object', result)) return '<span>' + '{ ' + entries(result).map(function (_ref, i, arr) { var k = _ref[0]; var v = _ref[1]; return '<span><span class="cm-property">' + k + '</span>: ' + formatResult(v) + coma(arr, i) + '</span>'; }) + ' ' + ' }' + '</span>'; return '<span class="cm-def">' + typeOf(result) + '</span>';
};
var wrapInDiv = function wrapInDiv(content) { return '<div style="padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, .05);">' + content + '</div>';
};
var __log = console.log.bind(console);
console.log = function () { for (var _len = arguments.length, messages = Array(_len), _key = 0; _key < _len; _key++) { messages[_key] = arguments[_key]; } if (!document.getElementById('console')) { document.body.innerHTML += '<div id="console" class="CodeMirror cm-s-dracula" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; height: initial;"></div>'; } var consoleNode = document.getElementById('console'); consoleNode.innerHTML += messages.map(compose(wrapInDiv, formatResult)).join(''); __log.apply(undefined, messages);
};
console.log('bar', 3, { foo: "bar" }, [1, 2, 3]);
Developer | Renaud Tertrais |
Username | renaudtertrais |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 3,320 Kb |
Views | 28,336 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
React-a11y-range | 7,029 Kb |
Animated logo SVG, CSS3 and JS | 3,432 Kb |
Flat CSS3 Breadcrumb | 3,093 Kb |
Angular JS - Basic app | 2,394 Kb |
Flat CSS3 rating system | 2,752 Kb |
React-draggable | 2,539 Kb |
Flat Blog layout in CSS3 | 4,111 Kb |
Images gallery with CSS3 transitions | 2,356 Kb |
Buttons wip... | 4,057 Kb |
TCP Brut Force | 4,629 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
HTML5 Video Autoplay | Zivcos | 1,352 Kb |
Basic jQuery Filter list | Mtedwards | 2,464 Kb |
A Pen by Huan Nghiem | Nightshade | 10,646 Kb |
Fixed with using Calc | Tomleo | 2,542 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
Loading animation with css | Icebob | 2,947 Kb |
Flexbox slider | Rendro | 3,459 Kb |
Css3 only dropdown menu | Riogrande | 2,519 Kb |
IE11 Test | Boostnewmedia | 4,998 Kb |
Pruebas de d3.js | Juanmanuelcarnerero | 2,485 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!