class and id in react
To specify a CSS class, use the **className** attribute. This applies to all regular DOM and SVG elements like
To specify a CSS class, use the **className** attribute. This applies to all regular DOM and SVG elements like
function foo() {} function bar() {} // To export above functions: module.exports = foo; module.exports = bar; // And in the file you want to use these functions, // import them like this: const foo = require(‘./module/path’); const bar = require(‘./module/path’); Here is what the above code is Doing: 1. We have two functions, foo…
var doc = new jsPDF(); doc.setDrawColor(0); doc.setFillColor(255, 0, 0); doc.rect(40, 50, 30, 12, ‘FD’); //Fill and Border doc.setFontSize(8); doc.setFontType(‘normal’); doc.text(‘hello’, 42, 51); Here is what the above code is Doing: 1. Create a new document 2. Set the draw color to black 3. Set the fill color to red 4. Draw a rectangle with a…
function setImageVisible(id, visible) { var img = document.getElementById(id); img.style.visibility = (visible ? ‘visible’ : ‘hidden’); } Here is what the above code is Doing: 1. It’s creating a function called setImageVisible. 2. It’s taking two parameters: id and visible. 3. It’s getting the image by id. 4. It’s setting the visibility of the image to…
/*If a function doesn’t provide an explicit return value, the special value undefined will be returned.*/ //Example let returnVal = console.log(“LaunchCode”); console.log(returnVal); //LaunchCode //undefined Here is what the above code is Doing: 1. The console.log() function is called with the argument “LaunchCode”. 2. The console.log() function prints “LaunchCode” to the console. 3. The console.log() function…
Math.round(num * 100) / 100 Here is what the above code is Doing: 1. We’re using the built-in Python function round() to round the number to two decimal places. 2. We’re using the built-in Python function str() to convert the number to a string. 3. We’re using the built-in Python function len() to get the…
npm i swiper Here is what the above code is Doing: 1. Importing the Swiper class from the swiper module. 2. Creating a new Swiper object. 3. Calling the swipe() method on the Swiper object.