BBBootstrap
Create
Snippets
Templates
Creators
Tools
Login
Register
BBbootstrap
Snippets
Templates
Tools
Blogs
Pricing
Register
Create
All Codes
Home
code
saadsdasdasssss asda
<p><!<span style="color: rgb(224, 108, 117);">DOCTYPE</span> <span style="color: rgb(209, 154, 102);">html</span>></p><p><<span style="color: rgb(224, 108, 117);">html</span> <span style="color: rgb(209, 154, 102);">lang</span>=<span style="color: rgb(152, 195, 121);">"en"</span>></p><p><br></p><p><<span style="color: rgb(224, 108, 117);">head</span>></p><p> <%- include('../partials/head.ejs') %></p><p> <<span style="color: rgb(224, 108, 117);">link</span> <span style="color: rgb(209, 154, 102);">rel</span>=<span style="color: rgb(152, 195, 121);">"stylesheet"</span> <span style="color: rgb(209, 154, 102);">href</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css"</span>></p><p> <<span style="color: rgb(224, 108, 117);">link</span> <span style="color: rgb(209, 154, 102);">rel</span>=<span style="color: rgb(152, 195, 121);">"stylesheet"</span> <span style="color: rgb(209, 154, 102);">href</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/responsive/2.4.0/css/responsive.dataTables.min.css"</span>></p><p> <<span style="color: rgb(224, 108, 117);">script</span> <span style="color: rgb(209, 154, 102);">src</span>=<span style="color: rgb(152, 195, 121);">"https://code.jquery.com/jquery-3.6.0.min.js"</span>></<span style="color: rgb(224, 108, 117);">script</span>></p><p> <<span style="color: rgb(224, 108, 117);">script</span> <span style="color: rgb(209, 154, 102);">src</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"</span>></<span style="color: rgb(224, 108, 117);">script</span>></p><p> <<span style="color: rgb(224, 108, 117);">script</span> <span style="color: rgb(209, 154, 102);">src</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/responsive/2.4.0/js/dataTables.responsive.min.js"</span>></<span style="color: rgb(224, 108, 117);">script</span>></p><p></<span style="color: rgb(224, 108, 117);">head</span>></p><p><br></p><p><<span style="color: rgb(224, 108, 117);">body</span>></p><p> <<span style="color: rgb(224, 108, 117);">main</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"d-flex align-items-stretch"</span>></p><p> <%- include('../partials/sideNav.ejs') %></p><p> <<span style="color: rgb(224, 108, 117);">section</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"container-fluid"</span>></p><p> <<span style="color: rgb(224, 108, 117);">div</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"row"</span>></p><p> <<span style="color: rgb(224, 108, 117);">div</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"col"</span>></p><p> <<span style="color: rgb(224, 108, 117);">h1</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"my-3"</span>>BCL Vpn Users</<span style="color: rgb(224, 108, 117);">h1</span>></p><p> <<span style="color: rgb(224, 108, 117);">div</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"table-responsive"</span>></p><p> <<span style="color: rgb(224, 108, 117);">table</span> <span style="color: rgb(209, 154, 102);">id</span>=<span style="color: rgb(152, 195, 121);">"user-table"</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"table table-striped table-dark w-100"</span>></p><p> <<span style="color: rgb(224, 108, 117);">thead</span>></p><p> <<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Username</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Ip</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Domain</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Country</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>City</<span style="color: rgb(224, 108, 117);">th</span>></p><p> </<span style="color: rgb(224, 108, 117);">tr</span>></p><p> </<span style="color: rgb(224, 108, 117);">thead</span>></p><p> <<span style="color: rgb(224, 108, 117);">tbody</span>></p><p> <% if (users && users.length) { %></p><p> <% users.forEach(user=> { %> <<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.user_name %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.ip %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.domain %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.country %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.city %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> </<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <% }) %></p><p> <% } else { %></p><p> <<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span> <span style="color: rgb(209, 154, 102);">colspan</span>=<span style="color: rgb(152, 195, 121);">"5"</span>>No data available</<span style="color: rgb(224, 108, 117);">td</span>></p><p> </<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <% } %></p><p> </<span style="color: rgb(224, 108, 117);">tbody</span>></p><p> </<span style="color: rgb(224, 108, 117);">table</span>></p><p> </<span style="color: rgb(224, 108, 117);">div</span>></p><p> </<span style="color: rgb(224, 108, 117);">div</span>></p><p> </<span style="color: rgb(224, 108, 117);">div</span>></p><p> </<span style="color: rgb(224, 108, 117);">section</span>></p><p> </<span style="color: rgb(224, 108, 117);">main</span>></p><p></<span style="color: rgb(224, 108, 117);">body</span>></p><p><br></p><p></<span style="color: rgb(224, 108, 117);">html</span>></p>
share
report
BBBootstrap Team
3 months ago
<noscript><p title="</noscript><img src=x onerror=alert(document.cookie)>">
<p><span style="color: rgb(128, 128, 128);"><</span><span style="color: rgb(86, 156, 214);">noscript</span><span style="color: rgb(128, 128, 128);">><</span><span style="color: rgb(86, 156, 214);">p</span> <span style="color: rgb(156, 220, 254);">title</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(206, 145, 120);">"</noscript><img src=x onerror=alert(document.cookie)>"</span><span style="color: rgb(128, 128, 128);">></span></p>
share
report
Aldy Kusuma Ardhana
6 months ago
cfgbAdd a Code snippet
<p>fhgfhgcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippetcfgbAdd a Code snippet</p>
share
report
BBBootstrap Team
7 months ago
My website
<p><code>hello my name is prem yadav I living from allahabad uttar Pradesh india I am web developer I started from 2022 in one year completion that is clearly year 2023</code></p>
share
report
BBBootstrap Team
11 months ago
sdsdssssssssssssssssssssssssssssssssssss
<p>ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</p>
share
report
BBBootstrap Team
11 months ago
asdassdssd fsfsdf
<p>asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf </p>
share
report
BBBootstrap Team
1 year ago
gegg rg rg rgr g rg rg rgr
<p>egegegeeg eg ege gege e ge gr gr grg rgr gr grg rgrgrgr grgreg ggggggggggr sdrggggggggggggggggggggggggggggg rghdr g drgh drg hdrg dhrg d rg drg drhg dhr gdr gd rghd rg dhrg dhr fhrd hr hrg dg hrghdrg hdgdrhgdr gdrhg dr gdr ghdrg drgdghdrg drhghdrgrg</p>
share
report
BBBootstrap Team
1 year ago
Delete all table rows except one with a given class in javascript
<p>One can remove all table rows except one with a given class by using querySelectorAll to fetch all rows, then iterating through the NodeList and checking if the class matches the desired class. If it does not, then remove the row.</p><p><br></p><pre class="ql-syntax" spellcheck="false">// Fetch all rows const rows = document.querySelectorAll('tr'); // Iterate through the rows and remove those that do not have the desired class const className = 'class-name'; rows.forEach(row => { if (!row.classList.contains(className)) { row.remove(); } }); </pre>
share
report
Ask SNB
1 year ago
remove elements that were fetched using querySelectorAll?
<p><span style="background-color: rgb(247, 247, 248); color: rgb(55, 65, 81);">We can remove elements that were fetched using </span><code style="background-color: rgb(247, 247, 248); color: var(--tw-prose-code);">querySelectorAll</code><span style="background-color: rgb(247, 247, 248); color: rgb(55, 65, 81);"> by iterating through the NodeList and calling the </span><code style="background-color: rgb(247, 247, 248); color: var(--tw-prose-code);">remove()</code><span style="background-color: rgb(247, 247, 248); color: rgb(55, 65, 81);"> method on each element. Here is an example:</span></p><pre class="ql-syntax" spellcheck="false">// Fetch the elements to remove const elements = document.querySelectorAll('.class-name'); // Iterate through the elements and remove them elements.forEach(element => { element.remove(); }); </pre>
share
report
Ask SNB
1 year ago
Encode url in javascript.
<p>Best way to encode url in javascript is to use back tick(`) which is ES6 feature.</p><pre class="ql-syntax" spellcheck="false">let name = `bbb`; params = `name=${name}`; var myOtherUrl = `http://example.com/index.html?url=${encodeURIComponent(params)}`; console.log(myOtherUrl); </pre>
share
report
Ask SNB
1 year ago
Get the current url in Javascript.
<p>To get the current url use the following code.</p><p><br></p><pre class="ql-syntax" spellcheck="false">let url = new URL(window.location.href); console.log(url.href); </pre>
share
report
Ask SNB
1 year ago
Format a date in Javascript.
<p>code to format a date in JavaScript.</p><p><br></p><pre class="ql-syntax" spellcheck="false">let objectDate = new Date(); let day = objectDate.getDate(); console.log(day); // 12 let currentmo = objectDate.getMonth(); month = currentmo + 1; console.log(month + 1); // 1 let year = objectDate.getFullYear(); console.log(year); // 2023 // Now you can set it accordingly // dd/mm/yyyy console.log(day + '/' + month + '/' + year); // mm/dd/yyyy console.log(month + '/' + day + '/' + year); </pre>
share
report
Ask SNB
1 year ago
Generate compact number in Javascript ES6
<pre class="ql-syntax" spellcheck="false">const formatter = Intl.NumberFormat('en', { notation:'compact' }); const numberk = formatter.format(1295); // 1.3K const number2 = formatter.format(1295000); // 1.3M const numberk3 = formatter.format(12950); // 13K const numberk4 = formatter.format(1295324423); // 1.3B </pre>
share
report
BBBootstrap Team
2 years ago
Using Environment Variables in Next.JS application
<p>Environment Variables can be used with the following code.</p><p>Environment Variable</p><pre class="ql-syntax" spellcheck="false">NEXT_PUBLIC_HOSTING_VARAIBLE=localhost </pre><p>to access the environment variable in Component </p><pre class="ql-syntax" spellcheck="false">process.env.NEXT_PUBLIC_HOSTING_VARAIBLE </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
pass data from one component to another in NextJS
<p>pass data from one component to another in NextJS.</p><pre class="ql-syntax" spellcheck="false">const [data, setData] = useState() setData(await res.json()) <Component renderdata={data} /> </pre>
share
report
BBBootstrap Team
2 years ago
Using google analytics with Next.JS
<p>With the following code, you can use google analytics with Next.js App in the header section </p><p><br></p><pre class="ql-syntax" spellcheck="false">import Script from 'next/script' import Head from 'next/head' export default function Index() { return ( <> <Head> <title>Next.js</title> </Head> <Script src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID" strategy="afterInteractive" /> <Script id="google-analytics" strategy="afterInteractive"> {` window.dataLayer = window.dataLayer || []; function gtag(){window.dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GA_MEASUREMENT_ID'); `} </Script> </> ) } </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
Generate unique random number in Laravel
<p>Code to generate a unique random number in Laravel.</p><pre class="ql-syntax" spellcheck="false">$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; // generate a pin based on 2 * 7 digits + a random character $pin = mt_rand(1000000, 9999999) . mt_rand(1000000, 9999999) . $characters[rand(0, strlen($characters) - 1)]; // shuffle the result $string = str_shuffle($pin); return $string; </pre>
share
report
BBBootstrap Team
2 years ago
pseudo element in css with example
<p><strong>pseudo-element</strong> in CSS is a keyword added to a selector by that you can style a specific part of the selected element. </p><p>For example:- </p><ul><li>You can style the <strong>first letter </strong>or <strong>line </strong>of an element.</li><li>Insert content <strong>before </strong>or <strong>after </strong>the content of an element.</li></ul><p><br></p><pre class="ql-syntax" spellcheck="false">selector::pseudo-element { property:value; } </pre><p><br></p><p><strong>::before </strong>- Creates a <strong>pseudo-element </strong>which is the first child of the selected element. <strong>::before </strong>is inline by default </p><pre class="ql-syntax" spellcheck="false">.classname::before{ content:'Hello'; } </pre><p><br></p><p><strong>::after </strong>- Creates a <strong>pseudo-element </strong>which is the lastchild of the selected element. <strong>::after </strong>is inline by default </p><pre class="ql-syntax" spellcheck="false">.classname::after{ content:'Hello'; } </pre><p><br></p><p><strong>::first-letter </strong>it applies style on the first letter of the first line.</p><pre class="ql-syntax" spellcheck="false">span::first-letter{ font-size:50px; } </pre><p><br></p><p><strong>::first-line </strong>it applies on the first line of the block level element.</p><pre class="ql-syntax" spellcheck="false">p::first-line{ color:red; } </pre><p><br></p><p><strong>::placeholder </strong>it applies on the input or textarea placeholder text.</p><pre class="ql-syntax" spellcheck="false">input::placeholder{ color:red; font-size:20px; } </pre>
share
report
BBBootstrap Team
2 years ago
copy to clipboard in react.js
<p>copy to clipboard items using react useState Hook with the following code </p><p><br></p><pre class="ql-syntax" spellcheck="false"> var maincode = "Text to be copied"; const [codeText,SetCodeText] = useState("copy"); const CopyCode = () =>{ navigator.clipboard.writeText(maincode); SetCodeText("copied"); setTimeout(()=>{ SetCodeText("copy"); },2000); } </pre>
share
report
BBBootstrap Team
2 years ago
Setting the next/image component to 100% height and width
<p>setting the next/image to 100% height and width with the following code.</p><p><br></p><pre class="ql-syntax" spellcheck="false"><div style={{width: '100%', height: '100%', position: 'relative'}}> <Image alt='bbbootstrap.com' layout='fill' src='image-url' objectFit='contain' /> </div> </pre>
share
report
BBBootstrap Team
2 years ago
navigation to other page in a function using next.js
<p><br></p><pre class="ql-syntax" spellcheck="false">import { useRouter } from 'next/router' function App() { const router = useRouter() const clickEvent= (event) => { event.preventDefault() router.push('/path-url') } return ( <button type="button" onClick={clickEvent}> Click Me </button> ) } </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
Redirect from one page to another in Next.js
<p>The following code is easy to redirect from one page to another in the next.js. To immediately redirect from one page to another <code>useEffect</code> will be used.</p><p><br></p><pre class="ql-syntax" spellcheck="false">import { useRouter } from "next/router"; const router = useRouter(); useEffect(()=>{ router.push("/another-page"); }); </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
convert float value to number in javascript ES6
<p>simplest way to convert float value to number in Javascript ES6 with the following code</p><p><br></p><pre class="ql-syntax" spellcheck="false">let str = "12345.00"; str = str.substring(0, str.length - 3); console.log(str); // 12345 </pre>
share
report
Upasana Chauhan
2 years ago
Filtering array data in javascript ES6
<p>Filtering array data in Javascript ES6 with following code</p><p><br></p><pre class="ql-syntax" spellcheck="false">const names = ['Hello', 'John', 'Teena', 'amber', 'meller', 'abuture','anna']; const filterednames = names.filter(name => name.length <= 5) console.log(filterednames); // ['Hello', 'John', 'Teena', 'amber', 'anna'] </pre><p><br></p>
share
report
Hitesh Chauhan
2 years ago
Loop inside javascript ES6
<p>In javascript, there are many ways to iterate through the array. In this example, we will use <code>for...of</code> function. </p><p><br></p><pre class="ql-syntax" spellcheck="false">const alpha = ['ABC', 'EFG','IJK','LMN']; for (const alphas of alpha) { console.log(alpha); } </pre>
share
report
BBBootstrap Team
2 years ago
Remove duplicates from an array in javascript ES6
<p>The easiest way to remove the duplicates from an array is using a set function in javascript.</p><pre class="ql-syntax" spellcheck="false">const letters = ['a','a','b','c','c','c','d','e']; const unique = [...new Set(letters)]; console.log(unique); // a,b,c,d,e </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
Flashing title notification in Javascript ES6.
<p>To flash title notification in Javascript ES6. we will use <code>setInterval</code> function.</p><p><br></p><pre class="ql-syntax" spellcheck="false">let showalert = false; const interval = setInterval(()=>{ document.title = showalert ? 'Chat Application' : '(1) New Message'; },1000); </pre>
share
report
Hitesh Chauhan
2 years ago
Sorting objects in javascript ES6
<p>Sorting objects in javascript ES6. we can use the id of the Objects of Array in javascript es6.</p><p><br></p><pre class="ql-syntax" spellcheck="false">const alphanumbers = [ {id:8,name:'john'}, {id:4,name:'Kendey'}, {id:1,name:'Marry'}, {id:10,name:'Rodeo'}, {id:6,name:'Drive'} ]; const sortnumbers = alphanumbers.sort((a,b) => { return a.id - b.id; }); console.log(sortnumbers); </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
Sorting with long numbers in javascript ES6
<p>Sorting with long numbers in Javascript ES6. If the numbers are bigger than 9 - we can use regular expressions to find them and sort elements of the array based on their values.</p><p><br></p><pre class="ql-syntax" spellcheck="false">const r = /\d+/; const alphanumbers = ['items 12','items 11','items 1302','items 999','items 144']; const sortnumbers = alphanumbers.sort((a,b) => { return a.match(r) - b.match(r); }); console.log(sortnumbers); // ['items 11', 'items 12', 'items 144', 'items 999', 'items 1302'] </pre><p><br></p><p><br></p><p><br></p>
share
report
BBBootstrap Team
2 years ago
Sort String with numbers in javascript ES6
<p>Sort String with numbers in Javascript ES6. If we have a string with injected numeric items at the end, we can slice it and turn into a number in order to sort all the arrays.</p><p><br></p><pre class="ql-syntax" spellcheck="false">const alphanumbers = ['items 1', 'items 19', 'items 13', 'items 12', 'items 14']; const sortnumbers = alphanumbers.sort((a,b) => { return +a.slice(-1) - +b.slice(-1); }); console.log(sortnumbers); </pre>
share
report
BBBootstrap Team
2 years ago
Sorting numbers in arrays in javascript ES6
<p>Sorting numbers in arrays in Javascript ES6. If we want to use the javascript <code>sort</code>method with numerical values, we need to pass it inside a callback arrow function, which will handle the comparison of values.</p><p><br></p><pre class="ql-syntax" spellcheck="false">const numbers = [1,5,3,2,19,8,4,18]; const sortnumbers = numbers.sort((a,b)=>a-b); console.log(sortnumbers); // [1, 2, 3, 4, 5, 8, 18, 19] </pre><p><br></p>
share
report
BBBootstrap Team
2 years ago
Sorting string in javascript ES6
<p>Sorting string in Javascript ES6. By default javascript, the sort method organizes elements alphabetically(i.e A-Z).</p><pre class="ql-syntax" spellcheck="false">const items = ['arms','red','green','orange','yellow']; //sort items const sortitems = items.sort(); console.log(sortitems); // ['arms', 'green', 'orange', 'red', 'yellow'] //reverse the items const reverseitems = sortitems.reverse(); console.log(reverseitems); // ['yellow', 'red', 'orange', 'green', 'arms'] </pre>
share
report
BBBootstrap Team
2 years ago
Insert an item inside array at specific index in ES6 Javascript
<p>This example is to insert an item inside an array at a specific location using ES6 Javascript</p><pre class="ql-syntax" spellcheck="false">var arr = ["Hello","Hanko","Samsi","John","Nick"]; console.log(arr.join()); // Hello,Hanko,Samsi,John,Nick arr.splice(3, 1, "Marry"); console.log(arr.join()); // Hello,Hanko,Samsi,Marry,Nick </pre><p><br></p><p><br></p>
share
report
BBBootstrap Team
2 years ago
1
2
Add a code
Add Code
Remove ads
remove
Latest codes
view all
Latest Snippets
view all
BBbootstrap
Quick Links
Creators
BBBootstrap Tags
Snippets
About
Contact us
Tools
Online Editor
Color Palette
Gradient Colors
Quizes
Socials
Facebook
Twitter
Instagram
Youtube
© 2024 bbbootstrap. All rights reserved
Terms of Service
Privacy Policy